Home » SQL & PL/SQL » SQL & PL/SQL » Generate trigger statement using store procedure
Generate trigger statement using store procedure [message #277504] Tue, 30 October 2007 06:58 Go to next message
kingo
Messages: 13
Registered: October 2007
Junior Member
Hi ,

I have a store procedure and I have a trigger statement which is refreshed each time so the trigger statement is lost and now I need to generate the trigger statement when even I run a store procedure.

Regds,
Kingo
Re: Generate trigger statement using store procedure [message #277505 is a reply to message #277504] Tue, 30 October 2007 07:00 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
What do you call a "trigger statement"? Can you be more specific?

MHE
Re: Generate trigger statement using store procedure [message #277509 is a reply to message #277505] Tue, 30 October 2007 07:04 Go to previous messageGo to next message
kingo
Messages: 13
Registered: October 2007
Junior Member
I dont want to call a trigger instead when I run my stored procedure I should generate the create trigger ... those entire statement hope you got it now.
Re: Generate trigger statement using store procedure [message #277512 is a reply to message #277509] Tue, 30 October 2007 07:11 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,


do you mean to say you want to create a trigger dynamically.now that's a very strange requirment../fa/1580/0/


regards,
Re: Generate trigger statement using store procedure [message #277515 is a reply to message #277512] Tue, 30 October 2007 07:18 Go to previous messageGo to next message
kingo
Messages: 13
Registered: October 2007
Junior Member
When I run that sp I should generate trigger statement.
  • Attachment: sp.txt
    (Size: 0.80KB, Downloaded 144 times)

[Updated on: Tue, 30 October 2007 07:24]

Report message to a moderator

Re: Generate trigger statement using store procedure [message #277516 is a reply to message #277509] Tue, 30 October 2007 07:25 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What is your real need?
Why do you want to dynamically create a trigger?
What is your Oracle version?
Why you sql.txt file is the same as your previous topic and has nothing to do with the current question?

Regards
Michel
Re: Generate trigger statement using store procedure [message #277518 is a reply to message #277516] Tue, 30 October 2007 07:27 Go to previous messageGo to next message
kingo
Messages: 13
Registered: October 2007
Junior Member
I have updated the file sorry for the inconvenience.
Re: Generate trigger statement using store procedure [message #277522 is a reply to message #277518] Tue, 30 October 2007 07:35 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
This looks like a procedure to generate something like audit triggers.

Some ideas:
- Why don't you write the output to a file? Afterwards you can execute the file as a script.
- You could use EXECUTE IMMEDIATE but I'm not a great fan of that.

MHE
Re: Generate trigger statement using store procedure [message #277523 is a reply to message #277515] Tue, 30 October 2007 07:42 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Does that attachment have anything to do with your question?

What we need you to do is to assume that we know absolutely nothing about your requirements, nothing about your system, and that your usage of 'store procedure' may well be different from the one defined in the manuals

Now, with that in mind, based on what you have written, do you think we are going to be able to work out what you want?

Take some time and write down clearly and precisely what you want, and if possible, add in a couple of examples.


[Ahh!!! now the right attachment is there, it makes much more sense]

[Updated on: Tue, 30 October 2007 07:46]

Report message to a moderator

Re: Generate trigger statement using store procedure [message #277532 is a reply to message #277518] Tue, 30 October 2007 08:09 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You seems to want a procedure that automatically generate trigger code for your tables.
It's a good start (although I'd use SQL but anyway).
What is your problem now?

Regards
Michel
Previous Topic: sql - index
Next Topic: ORA-00942 Error
Goto Forum:
  


Current Time: Sat Dec 10 16:45:46 CST 2016

Total time taken to generate the page: 0.07704 seconds