database trigger [message #402172] |
Thu, 07 May 2009 23:59 |
majid tahir
Messages: 39 Registered: July 2007 Location: Pakistan
|
Member |
|
|
I want to create a trigger that automatically exit the forms after six months. I have create a trigger but its not working accordingly.
|
|
|
|
|
|
Re: database trigger [message #402180 is a reply to message #402176] |
Fri, 08 May 2009 00:20 |
majid tahir
Messages: 39 Registered: July 2007 Location: Pakistan
|
Member |
|
|
If i have to read the whole documentation and then find my answer then why are you here for???? This portal provides assistant to save time. You people are here for providing fast response. It is requested to you to assist in the right manner.
|
|
|
|
Re: database trigger [message #402186 is a reply to message #402182] |
Fri, 08 May 2009 00:35 |
majid tahir
Messages: 39 Registered: July 2007 Location: Pakistan
|
Member |
|
|
My trigger and table is attached.
============================================================================
create table check_passcode
(pass_id varchar2(10),
pass_date date,
pass_flag varchar2(10));
========================================NEW=================================
declare
v_pass_id Varchar2(10);
v_pass_date date;
v_pass_flag varchar2(10);
begin
select pass_date,pass_flag into v_pass_date,v_pass_flag from check_passcode
where pass_id=1;
if v_pass_flag='N' then
exit_form;
else
if v_pass_date>= sysdate then
MESSAGE ('SORRRYYYYYYYYYYYYYYYY');
exit_form;
update check_passcode
set pass_flag='N';
else if v_pass_date+10< sysdate then
message('SORRRRYYYYYYYYYYYYYY');
exit_form;
update check_passcode
set pass_flag='N';
end if;
end if;
end if;
exception
when no_data_found then
insert into check_passcode (pass_id,pass_date,pass_flag)
values('1',sysdate,'y');
end;
|
|
|
|
Re: database trigger [message #402196 is a reply to message #402189] |
Fri, 08 May 2009 01:10 |
majid tahir
Messages: 39 Registered: July 2007 Location: Pakistan
|
Member |
|
|
Yes its a form level trigger. I am using it on when_new_form_instance. It is not working according to the requirement. I want that when the user change the system date the form should exit.
============================================================================
create table check_passcode
(pass_id varchar2(10),
pass_date date,
pass_flag varchar2(10));
========================================NEW=================================
declare
v_pass_id Varchar2(10);
v_pass_date date;
v_pass_flag varchar2(10);
begin
select pass_date,pass_flag into v_pass_date,v_pass_flag from check_passcode
where pass_id=1;
if v_pass_flag='N' then
exit_form;
else
if v_pass_date>= sysdate then
MESSAGE ('SORRRYYYYYYYYYYYYYYYY');
exit_form;
update check_passcode
set pass_flag='N';
else if v_pass_date+10< sysdate then
message('SORRRRYYYYYYYYYYYYYY');
exit_form;
update check_passcode
set pass_flag='N';
end if;
end if;
end if;
exception
when no_data_found then
insert into check_passcode (pass_id,pass_date,pass_flag)
values('1',sysdate,'y');
end;
|
|
|
|
|
|