Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create trigger using Stored procedure?

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
I need to create a trigger on a table that is constantly in use. Is there a way to create a stored procedure that will create the trigger after our weekly backup process?

thanks!

Leslie
 
I ended up using the following solution:
Code:
A simple SQL statement, (create trigger etc....) in a source member could do the trick. Here is what you would do: 
 
1) You would write your [well tested in advance] SQL code in a standard source member let's call it "NITETRIGER"   
2) You would create a simple CL program to execute the SQL code. The instruction to use is 
RUNSQLSTM SOURCELIB/SRCFILE SRCMBR (where SRCMBR would be replaced by NITETRIGER. 
 
You could either use a Job Scheduler or ROBOT/400 or even a DLYJOB instruction to delay the execution until a good time at night.

Thanks to an outside source.

Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top