Home » Developer & Programmer » Forms » Record not saved despite Transaction Successful message (Oracle Forms)
Record not saved despite Transaction Successful message [message #669175] Fri, 06 April 2018 21:17 Go to next message
Ani747
Messages: 11
Registered: March 2018
Junior Member
Hi Team,

Need your help in this.

I am working on a form with 3 data blocks (1 database and 2 Control Blocks).

This is the previous code I had written to Create (C)/Update (U) record and it worked fine :

if :choice='C' then
go_block('city4');
commit;
elsif :choice='U' then
commit;
end if;
standard.COMMIT;



However, I tried to reduce the excess statements by using :

go_block('city4');
Commit;


Now, when I try and add a new record, though i am getting the System generated message of "Transaction Successful, Record saved", it is not adding any new record in reality.

This is confusing as i tried swapping commit with Standard.commit in the new version, but still there was no change reflected

Please suggest.

Regards,
Ani
Re: Record not saved despite Transaction Successful message [message #669178 is a reply to message #669175] Sat, 07 April 2018 03:15 Go to previous messageGo to next message
Littlefoot
Messages: 21549
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
IF-THEN-ELSE you wrote is useless. COMMIT affects the whole form, you can't restrict it to one block.

COMMIT, i.e. COMMIT_FORM analyses the form, searching for changes you might have made. If you changed something, it'll save it into the database. However, if you did "manual" modifications (such as INSERT INTO or UPDATE in your form triggers or procedures), COMMIT will conclude that nothing changed and that there's nothing to be saved, and will inform you with the "No changes to save" message.

STANDARD.COMMIT bypasses all analyses and does what you said: commit, right now!

Therefore,
a) get rid of your own code and use built-in Forms committing (such as F10, Ctrl + S, yellow floppy disk toolbar icon)
b) if you must, use STANDARD.COMMIT
Re: Record not saved despite Transaction Successful message [message #669180 is a reply to message #669178] Sat, 07 April 2018 04:43 Go to previous messageGo to next message
Ani747
Messages: 11
Registered: March 2018
Junior Member
Thanks for your reply Sir,

However, I used Standard.commit as well and the values is still not getting updated.

The message i am getting on the Forms Page though is FRM40400:Transaction Complete : 1 records applied and saved.

In reality, no records are being saved.

Please suggest
Re: Record not saved despite Transaction Successful message [message #669187 is a reply to message #669180] Sat, 07 April 2018 15:28 Go to previous messageGo to next message
Littlefoot
Messages: 21549
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Oracle usually tells the truth. On the other hand, you say that nothing changed in the table. It seems that you have a mystery, and I don't have a way to look at it.

How did you check whether data was updated or not? Was it a SELECT statement? Look at GUI data grid (did you refresh it)? Requerying data in a form (should reflect changed data, but - according to your words - query returns the "old", unchanged values).
Re: Record not saved despite Transaction Successful message [message #669189 is a reply to message #669187] Sat, 07 April 2018 20:59 Go to previous messageGo to next message
Ani747
Messages: 11
Registered: March 2018
Junior Member
Agree with you sir when you say Oracle usually tells the truth.

How did you check whether data was updated or not? Was it a SELECT statement? - I check it using the Select * from Tablename command in SQL Developer.

It does not shows any new record

Look at GUI data grid (did you refresh it)? Requerying data in a form (should reflect changed data - Tried the same, no Changes observed Sir
Re: Record not saved despite Transaction Successful message [message #669192 is a reply to message #669189] Sun, 08 April 2018 04:10 Go to previous messageGo to next message
Littlefoot
Messages: 21549
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Just to test it: when you modify some value in a form, save those changes using Forms built-in toolbar, by pressing the yellow floppy disk "Save" icon. Then check what happened (using that SELECT statement in SQL Developer).

Also, probably too trivial, but - are you connected to the same user in both Forms and SQL Developer?
Re: Record not saved despite Transaction Successful message [message #669194 is a reply to message #669192] Sun, 08 April 2018 04:55 Go to previous messageGo to next message
Ani747
Messages: 11
Registered: March 2018
Junior Member
Thanks for your reply,

when you modify some value in a form, save those changes using Forms built-in toolbar, by pressing the yellow floppy disk "Save" icon. Then check what happened (using that SELECT statement in SQL Developer).

Tried that already Sir, The Save Icon in toolbar works perfectly.

are you connected to the same user in both Forms and SQL Developer? - Yes Sir, i am connected to the same user in both.
Re: Record not saved despite Transaction Successful message [message #669198 is a reply to message #669194] Sun, 08 April 2018 05:51 Go to previous messageGo to next message
Littlefoot
Messages: 21549
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
That's what I was afraid of Sad

STANDARD.COMMIT should work. I don't know why it does not ... I'm afraid I don't have further ideas, sorry.
Re: Record not saved despite Transaction Successful message [message #669214 is a reply to message #669198] Mon, 09 April 2018 02:49 Go to previous messageGo to next message
cookiemonster
Messages: 13864
Registered: September 2008
Location: Rainy Manchester
Senior Member
Generally you need to use standard.commit when you've used hard-coded inserts/updates etc instead of relying on the forms default functionality for modifying the tables.
Is that what you've done?
Re: Record not saved despite Transaction Successful message [message #669250 is a reply to message #669214] Mon, 09 April 2018 20:19 Go to previous messageGo to next message
Ani747
Messages: 11
Registered: March 2018
Junior Member
Yes Sir, I have tried Standard.Commit as well and despite getting the "Successfully Saved data" message, no new records are being saved using this code
Re: Record not saved despite Transaction Successful message [message #669252 is a reply to message #669250] Tue, 10 April 2018 02:51 Go to previous message
cookiemonster
Messages: 13864
Registered: September 2008
Location: Rainy Manchester
Senior Member
Well you're doing something wrong.
But since you've told us virtually nothing about what your form does it's not possible for us to even guess what.
If you want help you're going to have to describe what you have - what blocks you've got and whether they are database blocks. What triggers are involved and if you've got hard-coded inserts/updates where they are in the code and what they do.
Previous Topic: Oracle Form in Client System
Next Topic: Inserting & Retrieving BLOB using Form 6i
Goto Forum:
  


Current Time: Sun Apr 05 20:41:45 CDT 2020