Home » SQL & PL/SQL » SQL & PL/SQL » Trigger not working.
Trigger not working. [message #224987] Fri, 16 March 2007 07:01 Go to next message
ziggy25
Messages: 206
Registered: July 2005
Senior Member
Why do i get an error with this trigger?

CREATE OR REPLACE TRIGGER Scheduled_Jobs_After_Insert
AFTER INSERT ON SCHEDULED_JOBS
BEGIN
    pck_batch.write_batch_job_log('Job Scheduled Successfully',
                          'ERRORS_REPORT',
                          'S',
                          SYSDATE);
    commit;
END;
/


The error is saying that i can commit in a trigger. in that case how are changes in a trigger commited?

[Updated on: Fri, 16 March 2007 07:02]

Report message to a moderator

Re: Trigger not working. [message #224988 is a reply to message #224987] Fri, 16 March 2007 07:08 Go to previous messageGo to next message
rzkhan
Messages: 345
Registered: March 2005
Senior Member
As I know.. we can not use commit in such trigger.
Re: Trigger not working. [message #224990 is a reply to message #224987] Fri, 16 March 2007 07:12 Go to previous messageGo to next message
shanthkumaar
Messages: 156
Registered: February 2007
Location: india,chennai
Senior Member

hi,
u cannot give a commit inside the trigger directly.

But if you insist then you have to make this trigger transaction to be a Independent transaction from its parent transaction, You can do this by using Pragma. Pragma AUTONOMOUS_TRANSACTION allow you to build the Indepadent(child) Transaction,started by another. Should be declare in DECLARE section of any subprogram.



i searched the forum and found this link.
check this link below

click here

regards
shanth,
Re: Trigger not working. [message #225006 is a reply to message #224990] Fri, 16 March 2007 09:05 Go to previous message
ziggy25
Messages: 206
Registered: July 2005
Senior Member
Do i need to change existing tablespaces to use LMT? that would not be an easy task Razz
Previous Topic: execution and compilation of a procedure and function in shell scripting
Next Topic: ZIPCODE ISSUES with query
Goto Forum:
  


Current Time: Sun Dec 04 04:19:59 CST 2016

Total time taken to generate the page: 0.16374 seconds