Re: PL/SQL Referencing a table named in a column
From: Andy Hardy <aph_at_ahardy.demon.co.uk>
Date: 1997/03/11
Message-ID: <drSDOBAMDbJzEwtN_at_ahardy.demon.co.uk>#1/1
Anyone who is capable of getting themselves made President should on no account be allowed to do the job.
Date: 1997/03/11
Message-ID: <drSDOBAMDbJzEwtN_at_ahardy.demon.co.uk>#1/1
In article <5g1kd2$7t9_at_news1-alterdial.uu.net>, Jeff Arnfield
<jarnfiel_at_tricon.net> writes
>Is there a way I can get PL/SQL (either directly in the trigger or in
>a stored procedure) to get the name of the table to operate on from
>the column that contains that table name, then issue the delete,
>without hard-coding the table names in the PL/SQL block and using a
>conditional test to compare the table name stored in the column with
>table names known in the PL/SQL procedure?
You can get PL/SQL to do this using Dynamic SQL - check the manuals.
It's a shame to be moving the BLOBS about, otherwise a cascade delete rule would be easy to implement.
Andy
Andy Hardy. PGP key available on request
Anyone who is capable of getting themselves made President should on no account be allowed to do the job.
- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"