Prepare for your Next Interview
This is a discussion on Inserting instead of updating within the Oracle forums, part of the Databases category; Hello, I have written following code for update button in a form. It is inserting new record instead of updating existing record. Could you please suggest me what might be ...
|
|||
|
Inserting instead of updating
Hello,
I have written following code for update button in a form. It is inserting new record instead of updating existing record. Could you please suggest me what might be the problem? IF :System.Form_Status = 'CHANGED' THEN UPDATE DSL_SUPPLIER_MASTER SET DSL_SUPP_ADD1 = : DSL_SUPP_ADD1, DSL_SUPP_ADD2 = : DSL_SUPP_ADD2, DSL_SUPP_ADD3 = : DSL_SUPP_ADD3, DSL_CREATEDDATE = SYSDATE WHERE LTRIM(RTRIM(DSL_SUPP_NAME)) = LTRIM(RTRIM(: DSL_SUPP_NAME)) AND LTRIM(RTRIM(DSL_SUPP_CODE)) = LTRIM(RTRIM(: DSL_SUPP_CODE)); END IF; Commit; Thanks in advance. Krishna |
| Sponsored Links |
|
|||
|
Re: Inserting instead of updating
New Row is inserted because u used commit at the end of updation u try forms_ddl('Commit') .I think it will work
|
| The Following User Says Thank You to susarlasireesha For This Useful Post: | ||
|
|||
|
please check the form status by putting in message of when-button-pressed trigger.
the commit built-in is inserting the record because of unchanged form status. in case u can not find it put break and debug it. |
|
|||
|
Re: Inserting instead of updating
nothing wrong with the code, cross check for the form status and the action carried out thereof, SQL has not become intelligent to perform an Insert instead of Update
![]() |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cyclic Updating | JobHelper | Oracle | 2 | 10-13-2007 04:06 AM |
| Error while inserting or updating | Geek_Guest | SQL | 1 | 09-09-2007 10:28 AM |
| Inserting nextval after sequence has reached maximum value | Geek_Guest | Oracle | 7 | 08-14-2007 07:51 AM |
| Inserting column in existing table | svigneshwari | Oracle | 4 | 07-30-2007 09:31 AM |
| Updating Java version | Geek_Guest | Java | 1 | 04-16-2007 08:13 AM |