Home » SQL & PL/SQL » SQL & PL/SQL » How to call a procedure in INSERT Trigger (Oracle 9i, Winxp)
How to call a procedure in INSERT Trigger [message #396235] Sun, 05 April 2009 06:37 Go to next message
mahatab
Messages: 98
Registered: January 2008
Location: Dhaka
Member

Hi,
I have written a procedure and now i wanted to call the procedure to execute when INSERT Trigger fire written for a particular table. Please provide me the sample code and hope it will work for me.

Regards,
Mahatab Masud
Re: How to call a procedure in INSERT Trigger [message #396237 is a reply to message #396235] Sun, 05 April 2009 07:21 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Search the Forum / Google.
Here is one example.

By
Vamsi
Re: How to call a procedure in INSERT Trigger [message #396287 is a reply to message #396235] Mon, 06 April 2009 01:14 Go to previous messageGo to next message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
Hello mahatab,

Hope following code will help you.

SQL>DESC TEST;
 Name                                                                                                              Null?    Type
 ---------------------------------------------------------------------------------------------------
 TESTCOL                                                                                                                    VARCHAR2(50)

SQL>CREATE OR REPLACE PROCEDURE TEST_PROC
  2  AS
  3  BEGIN
  4   DBMS_OUTPUT.PUT_LINE('This is the test procedure');
  5  END;
  6  /

Procedure created.

SQL>BEGIN
  2  TEST_PROC;
  3  END;
  4  /
This is the test procedure

PL/SQL procedure successfully completed.

SQL>CREATE OR REPLACE TRIGGER TEST_AI
  2  AFTER INSERT ON TEST
  3  BEGIN
  4   TEST_PROC;
  5  END;
  6  /

Trigger created.

SQL>INSERT INTO TEST VALUES('ABC');
This is the test procedure

1 row created.


regards,
Delna
Re: How to call a procedure in INSERT Trigger [message #396290 is a reply to message #396235] Mon, 06 April 2009 01:20 Go to previous messageGo to next message
mahatab
Messages: 98
Registered: January 2008
Location: Dhaka
Member

Thank You,
The code you provided is quite handy for me and i assume that it will solve out my problem. Once again thanks for the kind concern you have shown.

Regards,
Mahatab Masud
Re: How to call a procedure in INSERT Trigger [message #396292 is a reply to message #396290] Mon, 06 April 2009 01:24 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
You & delna.sexy are a match made in heaven.
ENJOY each other!
Re: How to call a procedure in INSERT Trigger [message #396293 is a reply to message #396290] Mon, 06 April 2009 01:25 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
mahatab wrote on Mon, 06 April 2009 08:20
Thank You,
The code you provided is quite handy for me and i assume that it will solve out my problem. Once again thanks for the kind concern you have shown.

Regards,
Mahatab Masud

It is about the same code that is in the link you have been provided yesterday; didn't you read it?

Regards
Michel
Re: How to call a procedure in INSERT Trigger [message #396299 is a reply to message #396235] Mon, 06 April 2009 01:36 Go to previous messageGo to next message
mahatab
Messages: 98
Registered: January 2008
Location: Dhaka
Member

Sorry i didn't noticed the fact. Anyway i am surprised to have such a comments in the forum, though being a technical people we deserve the right to have some fun.

Regards,
Mahatab Masud
Re: How to call a procedure in INSERT Trigger [message #396548 is a reply to message #396292] Tue, 07 April 2009 03:22 Go to previous messageGo to next message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
Hey BLACK colored DUCK,
You stop your QUACK-QUACK specially for my post, as I said so far.
I am surperized that why others are speechless.
Re: How to call a procedure in INSERT Trigger [message #396551 is a reply to message #396292] Tue, 07 April 2009 03:34 Go to previous messageGo to next message
raja.or.king
Messages: 24
Registered: November 2008
Location: GJ 5
Junior Member
This type of vulgarity of BlackSwan must not be tolerated. He should be rusticated from the forum, his membership should be cancalled. And I think, forum wont get any loss because he cannot speak anything else than FORMAT YOUR POST.

regards,
Naresh

[Updated on: Tue, 07 April 2009 03:34]

Report message to a moderator

Re: How to call a procedure in INSERT Trigger [message #396569 is a reply to message #396551] Tue, 07 April 2009 04:17 Go to previous messageGo to next message
tejas.patel
Messages: 22
Registered: December 2008
Location: NJ
Junior Member

yes i am agree with raja.or.king. blackswan must be punished.

[Updated on: Tue, 07 April 2009 04:20]

Report message to a moderator

Re: How to call a procedure in INSERT Trigger [message #396585 is a reply to message #396569] Tue, 07 April 2009 05:00 Go to previous messageGo to next message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
i think first
He should read the forum guide lines

regards
Sriram
Re: How to call a procedure in INSERT Trigger [message #396620 is a reply to message #396235] Tue, 07 April 2009 06:09 Go to previous message
mahatab
Messages: 98
Registered: January 2008
Location: Dhaka
Member

Hi,
Thank you all for the support you have all provided against the violation of rules of this forum. I do believe hurting someone is very bad habit when he/she is trying to help you or somebody else. We are here to get some help to do help.


Regards,
Mahatab Masud
Previous Topic: Dynamic Connection in SQLPLUS
Next Topic: Oracle Float to Date Conversion
Goto Forum:
  


Current Time: Wed Feb 19 05:45:13 CST 2025