save button works only once [message #558754] |
Tue, 26 June 2012 07:00 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/d6a324777e8ad953ab838276b55cb345?s=64&d=mm&r=g) |
kriti.akanksha
Messages: 28 Registered: March 2012
|
Junior Member |
|
|
declare
blk_name varchar2(60);
form_name varchar2(60);
str_base_table varchar2(60);
bt number;
alert number;
begin
insert into AUTH_SLIP_RET(ALT_ID,AU_SLIP,EDT,DOR_SLIP,USERNAME,REASON,DEBAR,RECONSIDER,REG_WAIT,VR_CF,OCC_STATUS)
values(:AUTH_SLIP_RET.ALT_ID,:AUTH_SLIP_RET.AU_SLIP,:AUTH_SLIP_RET.EDT,:AUTH_SLIP_RET.DOR_SLIP,
:AUTH_SLIP_RET.USERNAME,:AUTH_SLIP_RET.REASON,:AUTH_SLIP_RET.DEBAR,:AUTH_SLIP_RET.RECONSIDER,
:AUTH_SLIP_RET.REG_WAIT,:AUTH_SLIP_RET.VR_CF,:AUTH_SLIP_RET.OCC_STATUS);
VACATION_PKG.RET_AUTH_SLIP(:alt_trans.alt_id);
IF SQL%FOUND THEN
standard.commit;
set_alert_property('alert57',title,'success');
set_alert_property('alert57',alert_message_text,'Authority slip return successfully');
alert:= show_alert('alert57');
clear_form(NO_VALIDATE);
ELSE
set_alert_property('alert57',title,'success');
set_alert_property('alert57',alert_message_text,'Authority slip return un-successfull');
alert:= show_alert('alert57');
clear_form(NO_VALIDATE);
-- EXIT_FORM(no_commit);
END IF;
end;
this is my coding on save button. this is working fine but only once. when i enter the data second time and try to save, it didn't do anything. what should i do?
|
|
|
|
|
|
|
Re: save button works only once [message #559214 is a reply to message #558772] |
Fri, 29 June 2012 16:42 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
If it worked more than once you would almost certainly get an ORA-00001 error.
Forms will insert the record automatically, writing code to do the same is stupid.
Also, why is the sql%found after a package call? Which exact sql statement do you think that is checking?
|
|
|