Re: PL/SQL Referencing a table named in a column

From: Pauli Salmu <pauli.salmu_at_pp.kolumbus.fi>
Date: 1997/03/11
Message-ID: <3324B72F.F40_at_pp.kolumbus.fi>#1/1


Jeff Arnfield wrote:
>
> We have an application that includes some BLOBS of varying size. To
> minimize chaining and facilitate storage management, we're putting the
> BLOBs in separate tables and refering to them using a numeric key.
> However, upon deleting a row that refers to a BLOB, I want to use a
> trigger to also delete the row containing the actual BLOB in the
> separate table.
>
> It's possible that we'll choose to move the BLOBs to different tables,
> depending upon size, query frequency and access speed requirements.
> For that reason, I'd like to store the name of the table containing
> the BLOB in a column in the table that references the blob.

Why not a somewhat simpler approach: define a foreign key constraint for the BLOB table that references the master table with ON DELETE CASCADE option and there you have an automatic delete. Received on Tue Mar 11 1997 - 00:00:00 CET

Original text of this message