PL/SQL Procedure parameter question

From: Ross Klippert <rossk_at_cso.geg.mot.com>
Date: 1995/07/13
Message-ID: <1995Jul13.220406.23743_at_schbbs.mot.com>#1/1


---
Is it possible to pass a table name into a PL/SQL procedure as a parameter
and use it in an UPDATE statement?

I have a number of tables which all have a numeric Unique_ID and a 
Date_Last_Modified field and I need to be able to update the Date_Last Modified
every time a row is updated.  Instead of defining a trigger for each table that
executes its own copy of:

   UPDATE <table_name> SET Date_Last_Modified = SYSDATE WHERE Unique_ID = <uid>;

I would like to create a procedure that takes table_name and uid as input
parameters and executes a single UPDATE statement.

This would allow each table to have a trigger that made a single procedure
call like:

	New_DLM (table_name => 'PERSON_TABLE', uid => new.Unique_ID);


Please copy my E-mail with any follow up discussion.

Thanks,


------------------------------------------------------------------------------
Ross Klippert | Motorola GSTG | Scottsdale, AZ | rossk_at_cso.geg.mot.com | (602)-441-6794 |
------------------------------------------------------------------------------
Received on Thu Jul 13 1995 - 00:00:00 CEST

Original text of this message