Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Sql Help

Re: Sql Help

From: gabriel <gabriel_at_kabah.com>
Date: 2000/04/27
Message-ID: <8ea0i5$5tj@journal.concentric.net>#1/1

Here are two line from my audit trail tabe definition that may help you:

    USERNAME VARCHAR2(50) DEFAULT USER,
    DATETIME DATE DEFAULT SYSDATE "Gary Knopp" <gknopp_at_ascend.com> wrote in message news:8e9uqq$325_at_nntpb.cb.lucent.com...
> Hello,
>
> I have an application that connects to an oracle database through a
> single
> user account. When the application issues an 'update' or 'insert' it
 sends
> the username as part of the sql syntax...
>
> Update myTable
> set f1 = 'blah'
> f2 = 'blahblah'
> user = 'Smith'
>
> Triggers are used to store the old record value and username in a history
> table.
>
> The problem is if I have a 'delete' statement there is no way to send the
> username along with the sql syntax to identify who is deleting the
 record.
> The delete trigger can write the record to the history table, but with no
> user identified. Although I could issue a separate sql statement to
 insert
> the old record into the history table for Deletes. I would rather the
> database
> trigger handle that.
>
> Is there anyway I can create a procedure to set a variable that the delete
> trigger can use to fill in the username???
>
> procedure delRecord(sql,username);
>
>
>
>
>
>
>
Received on Thu Apr 27 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US