Updating a Record through Form [message #527172] |
Sun, 16 October 2011 03:23 |
|
shanie
Messages: 118 Registered: January 2011
|
Senior Member |
|
|
Dear All,
I tried to update a record through oracle form.
Record is updating but instead of one, two records are updated with same data.
First I enter Student ID then It fetches the data from database table. Then I modify the data and click on Update command button.
It gives message i record applied and saved.
But in database two records with identical data is coming.
Update saturn.GZBGSSP set
GZBGSSP_LEVEL = :GZBGSSP_LEVEL,
GZBGSSP_DEG_PLAN_IND = :GZBGSSP_DEG_PLAN_IND,
GZBGSSP_DEG_PLAN_DATE = :GZBGSSP_DEG_PLAN_DATE,
GZBGSSP_COM_EXAM_IND = :GZBGSSP_COM_EXAM_IND,
GZBGSSP_COM_EXAM_DATE = :GZBGSSP_COM_EXAM_DATE,
GZBGSSP_FT_RESD_IND = :GZBGSSP_FT_RESD_IND,
GZBGSSP_FT_RESD_DATE = :GZBGSSP_FT_RESD_DATE
Where GZBGSSP_STU_ID = :DUAL.KEY_ID and GZBGSSP_LEVEL = :dual.GZBGSSP_LEVEL;
Commit;
Please Help!
Thanks & Regards,
Shanie
|
|
|
|
Re: Updating a Record through Form [message #527178 is a reply to message #527176] |
Sun, 16 October 2011 05:50 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
I assume you're using selects to populate the block rather than execute query?
If so then the second record will come from forms inserting the data in the block. If you put data in a database block forms will assume it's a new record and insert it.
As Irfan says - use forms default behaviour - execute query to get the data and save to update.
|
|
|
|
|
|
|
Re: Updating a Record through Form [message #527599 is a reply to message #527598] |
Wed, 19 October 2011 03:51 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
shanie wrote on Wed, 19 October 2011 09:47By going through Steps Query->Enter Query ->Execute Query->Save
It is time consuming Process.
However it is the correct process.
The reason for your problem is what I said above. Use execute query to get the data and the problem will go away.
|
|
|
|
|
|
|
|
|
Re: Updating a Record through Form [message #528218 is a reply to message #528205] |
Sun, 23 October 2011 03:38 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
It gives that message whenever you make changes to a database datablock and then do something that'll remove the record you've just changed
(clear_record, clear_block, execute_query etc).
What does the OK button do?
|
|
|
|
|
|
Re: Updating a Record through Form [message #528303 is a reply to message #528268] |
Mon, 24 October 2011 03:39 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Is the button in the same datablock as the date item?
Do you do anything in the form before pressing the button to call the LOV?
Run the form in debug mode and see what triggers fire when you call the LOV.
|
|
|
|
|
|