Home » Fusion Middleware & Colab Suite » Weblogic & Application Server » create trigger for each last day of month
create trigger for each last day of month [message #77101] Wed, 01 September 2004 03:41 Go to next message
Manolito
Messages: 2
Registered: September 2004
Junior Member
Hi all.
This is the first time i post on this forum.
First of all, sorry for my english
I have to create a trigger every last day of month.
I saw a lot tutorials about triggers, but no one tell me how to do this...
May this run correct??

CREATE OR REPLACE TRIGGER fin_mes
AFTER UPDATE OF sysdate ON dual
FOR EACH ROW WHEN (sysdate=last_day)
DECLARE
.......
BEGIN
.......
END fin_mes;
/
This is for a september exam.
Thanks a lot
Re: create trigger for each last day of month [message #77102 is a reply to message #77101] Wed, 01 September 2004 14:49 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
No, you can't update "sysdate" - it is a pseduo column (you reference it as if it was a column in a table, but you can only select it).

Also, Dual is actually a sys table, but it only every has one row and one column. You never update, delete or insert into dual.
Re: create trigger for each last day of month [message #77104 is a reply to message #77102] Thu, 02 September 2004 01:17 Go to previous messageGo to next message
Manolito
Messages: 2
Registered: September 2004
Junior Member
Ok... thank you very much...
Another question.
What i want to do, i can do with the dbms_job..
But, can you explain me how to use this tool?. I mean, create a new job with dbms_job.submit. I read a lot of this, but i can't understand how to do each last day of month in a pl-sql.I think i have to create a procedure which contains that utility...
Thank you very much.
Re: create trigger for each last day of month [message #77258 is a reply to message #77102] Thu, 16 December 2004 04:30 Go to previous message
Greg
Messages: 35
Registered: July 2000
Member
Create a job thru dbms_job that will run a stored procedure that you will create. This stored procedure should contain the following:

if TO_CHAR(LAST_DAY(SYSDATE),'MM/DD/YYYY') =
TO_CHAR(SYSDATE,'MM/DD/YYYY') then

... (whatever you want it to do)

end if;
Previous Topic: TCL (adp) pages
Next Topic: how to install oracle 9i Application server on windows2000 having oracle 9i database already install
Goto Forum:
  


Current Time: Fri Nov 22 08:43:13 CST 2024