Home » Developer & Programmer » Forms » save button works only once
save button works only once [message #558754] Tue, 26 June 2012 07:00 Go to next message
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 #558759 is a reply to message #558754] Tue, 26 June 2012 07:12 Go to previous messageGo to next message
Littlefoot
Messages: 18822
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It appears that SQL%FOUND returned FALSE and COMMIT was never issued.
Re: save button works only once [message #558762 is a reply to message #558759] Tue, 26 June 2012 07:19 Go to previous messageGo to next message
kriti.akanksha
Messages: 28
Registered: March 2012
Junior Member
but IF SQL%FOUND returns FALSE then i should get message 'Authority slip return un-successfuly' but i am also not getting anything not even clear_form is clear the form
Re: save button works only once [message #558763 is a reply to message #558762] Tue, 26 June 2012 07:25 Go to previous messageGo to next message
Littlefoot
Messages: 18822
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Is there, perhaps, WHEN OTHERS exception handler in the VACATION_PKG.RET_AUTH_SLIP procedure? If so, remove it and run the form again. What happens?
Re: save button works only once [message #558772 is a reply to message #558754] Tue, 26 June 2012 08:19 Go to previous messageGo to next message
joy_division
Messages: 4453
Registered: February 2005
Location: East Coast USA
Senior Member
This "save button" is not on the AUTH_SLIP_RET block, is it?
Re: save button works only once [message #559214 is a reply to message #558772] Fri, 29 June 2012 16:42 Go to previous message
cookiemonster
Messages: 10571
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?
Previous Topic: HELP!! Need Oralce developer 6i installation disk/file
Next Topic: dummy background text in item
Goto Forum:
  


Current Time: Thu Apr 17 03:45:52 CDT 2014

Total time taken to generate the page: 0.06157 seconds