Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > Oracle
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 18th, 2006, 11:27 AM
Authorized User
 
Join Date: Aug 2003
Location: Pittsburgh, PA, USA.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default oracle trigger (how to move forward)

I have an oracle trigger that works fine when you manually run it. How can I take the following trigger and make it repeat instead of specifically copying it for each table. For instance..

I have to run this several times for each different 'company'.

accept compnum prompt 'Enter Company Number: '
define logging = "_logging" (CHAR)

create or replace trigger ttfacp100&compnum&logging
before insert on ttfacp100&compnum
for each row
declare
        logname varchar2(8);
begin
                select user into logname from dual;
        :new.t$logn := logname;
end;

/

----------------------------------------------------------------
I want to be able to have a list of companies that run the trigger each time it changes, but only call this script once.
Can something like this be done?

define logging = "_logging" (CHAR)
define compnum = 100
run.trigger()

define compnum = 200
run.trigger()

define compnum = 300
run.trigger()

run.trigger()
{
create or replace trigger ttfacp100&compnum&logging
before insert on ttfacp100&compnum
for each row
declare
        logname varchar2(8);
begin
                select user into logname from dual;
        :new.t$logn := logname;
end;
/
}


Thank you!
-Tim


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
oracle database trigger jlnashrod Oracle 1 October 3rd, 2007 01:41 AM
Forward after Login ~Bean~ ASP.NET 1.0 and 1.1 Basics 1 July 14th, 2005 06:14 PM
Oracle Trigger help please... tnzabo Oracle 1 March 2nd, 2005 06:05 AM
Forward booking rahilahmed Pro VB Databases 1 June 16th, 2004 07:02 PM
Forward Booking rahilahmed Excel VBA 0 May 24th, 2004 10:25 AM



All times are GMT -4. The time now is 08:59 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.