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: Trigger error

Re: Trigger error

From: Lothar Armbrüster <la_at_oktagramm.de>
Date: Wed, 7 Mar 2001 18:21:32 +0100
Message-ID: <PM00037EEE05B18EFB@hades.unknown.dom>

Peta Griffith wrote:
> Trigger Error
> using the oracle oledb provider and ado with visual basic
> when creating a trigger
>
> this statement will return then error 'No value given for one or more
> required parameters'
>
> con.execute "CREATE OR REPLACE TRIGGER SYLOGIN.TRI_SEQ_ERRORLOG BEFORE
> INSERT ON SYLOGIN.ERRORLOG FOR EACH ROW BEGIN SELECT
> SYLOGIN.SEQ_ERRORLOG.nextval INTO : new.ID FROM dual; END;"
>

Hello Peta,
You cannot put a blank between the colon and the new.id. Try it like this:
.. into :new.id from dual;

IIRC there is a much better way to set the new ID: begin :new.id := sylogin.seq_errorlog.nextval; end;

This way you don't need to do a select to get the sequence value.

Hope that helps,
Lothar

-- 
Lothar Armbrüster       | la_at_oktagramm.de
Hauptstr. 26            | la_at_heptagramm.de
D-65346 Eltville        | lothar.armbruester_at_t-online.de
Received on Wed Mar 07 2001 - 11:21:32 CST

Original text of this message

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