Re: Newbie Trigger Question

From: Daniel A. Morgan <Daniel.Morgan_at_attws.com>
Date: Tue, 17 Jul 2001 11:12:05 -0700
Message-ID: <3B547FF5.2DE96333_at_attws.com>


Andre Cerri wrote:

> A couple of questions for you all. I need to update an ODBC DSN when certain
> SQL statements are executed. I either want to add an entry to a local
> 'Journal' Table, or update the ODBC DSN directly.
>
> 1) Does an Oracle trigger have access to the actual SQL statement that
> caused it to be fired? For example, table ABC has an insert trigger that
> says:
>
> INSERT INTO Journal set STATEMENT = sqlstatement
>
> So when I execute INSERT INTO ABC set COL1=1,COL2=2 the resultant
> trigger evaluates to:
>
> INSERT INTO Journal set STATEMENT = 'INSERT INTO ABC set COL1=1,COL2=2'
>
> 2) Can an Oracle trigger update an ODBC DSN directly? Is this possible using
> the Transparent Gateway? If so, is the overhead of making and breaking the
> connection each time to high to make this feasible?
>
> Cheers
>
> Andre
> Note anti-spam measures in email address.....

Q1: No. Though you might be able to write some SQL that would. Generally speaking triggers are not used in a situation such as yours. It is far more efficient to send the values to a stored procedure and have the proc perform the insert as well as performing the journal entries.

Q2: I have no idea. Perhaps someone else can help you.

Daniel A. Morgan Received on Tue Jul 17 2001 - 20:12:05 CEST

Original text of this message