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: Advice needed: Insert user in a field via TRIGGER

Re: Advice needed: Insert user in a field via TRIGGER

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Tue, 17 Nov 1998 14:04:21 GMT
Message-ID: <36528227.2901932@192.86.155.100>


A copy of this was sent to Pablo.picasso_at_cyberdude.com (Pablo Picasso) (if that email address didn't require changing) On Tue, 17 Nov 1998 13:00:56 GMT, you wrote:

>Hi all,
>
>can someon tell me please how to write a trigger which fires on
>insert and writes the actual user-name in a field ?
>
>I wrote one which is inserted with compilation errors ..
>
>CREATE OR REPLACE TRIGGER BEFORE INSERT ON LEXIKON
>BEGIN
> SELECT USER INTO NEW.BENUTZER FROM DUAL;
>END
>
>AND I tried this one :
>
>CREATE OR REPLACE TRIGGER BEFORE INSERT ON LEXIKON
>DECLARE
> dummy varchar)30);
>BEGIN
> SELECT USER INTO :dummy FROM DUAL;
> NEW.BENUTZER = :dummy;
>END
>

it would simply be:

CREATE OR REPLACE TRIGGER
BEFORE INSERT ON LEXIKON
FOR EACH ROW
BEGIN
   :new.benutzer := USER;
end;

the triggers needs to

>
>But both didn't work..
>
>Thanks in advance
>
>Oliver
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Tue Nov 17 1998 - 08:04:21 CST

Original text of this message

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