Home » Developer & Programmer » Forms » commit problem
commit problem [message #236477] Thu, 10 May 2007 01:24 Go to next message
rzkhan
Messages: 345
Registered: March 2005
Senior Member
Hi..

I have a multi-record database block. and a push button. under the when-button-pressed trigger I am using the statement

declare
v_loc number;	
  d number;
  d_to number;
BEGIN
     d:=:cbk.day_from;
     d_to:=:cbk.day_to;

	if d> d_to then
							message('Please Correct date sequence');
							go_item('cbk.day_from');
							raise form_trigger_failure;
				else
							if :cbk.mymonth IN('JAN','MAR','MAY','JUL','AUG','OCT','DEC') then
 									if :cbk.day_to >31 then
 										message('Check Last Date');
 										raise form_trigger_failure;
 									end if;
 							elsif :cbk.mymonth IN('APR') then
 										if :cbk.day_to >30 then
 										message('Check Last Date');
 										raise form_trigger_failure;
 									end if;
 							elsif :cbk.mymonth='FEB' then
       						if mod(:cbk.myyear,4)<>0 then
      							if :cbk.day_to >28 then
	 									message('Check Last Date');
	 									raise form_trigger_failure;
 										end if;
									elsif mod(:cbk.myyear,4)=0 then
      							if :cbk.day_to >28 then
	 									message('Check Last Date');
	 									raise form_trigger_failure;
 										end if;
							end if;
			end if;
 
  for x in d..d_to 
  loop
 insert into attendance values (:cbk.member_id_temp,d||'-'||:cbk.mymonth||'-'||:cbk.myyear,1,null);
  d :=d+1;
  end loop;
	end if;      
exception
		when others then
		message('something wrong');

       BEGIN
       	
--fetch first 15 days into second block
go_block('attendance');

set_block_property('attendance',default_Where,'member_id=:cbk.member_id_temp 
and to_char(a_date,''MON'')= :cbk.mymonth
and to_char(a_date,''YYYY'')=:cbk.myyear
and to_char(a_date,''DD'')<16');
execute_query;


--fetch last 15,16 days into second block
go_block('attendance2');
set_block_property('attendance2',default_Where,'member_id=:cbk.member_id_temp 
and to_char(a_date,''MON'')= :cbk.mymonth
and to_char(a_date,''YYYY'')=:cbk.myyear
and to_char(a_date,''DD'')>15');
execute_query;

---put cursor back into first block
go_block('attendance');

:cbk.day_from:=NULL;
:cbk.day_to:=NULL;

go_item('cbk.day_from');
       end;

END;


By pressing this button the records are saved even I did not issue COMMIT or COMMIT_FORM;

I wonder why this is so?

in this session or next session when I issue execute_query builtin the records are fetched and shown.

Could any body clarify my doubt?

Thank you,




Re: commit problem [message #236480 is a reply to message #236477] Thu, 10 May 2007 01:34 Go to previous message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
insert into attendance values (:cbk.member_id_temp,d||'-'||:cbk.mymonth||'-'||:cbk.myyear,1,null);


Check this
Previous Topic: Close URL window
Next Topic: Icon not getting displayed over the Pushbuttons after forms migration.
Goto Forum:
  


Current Time: Sat Dec 10 16:40:35 CST 2016

Total time taken to generate the page: 0.08249 seconds