Re: ODBC & Correlation Name (:new and :old)
Date: 20 Aug 2003 17:26:03 -0700
Message-ID: <233b7a65.0308201626.225c555_at_posting.google.com>
"Chris Blair" <chris_w_blair_at_yahoo.com.uk.zz> wrote in message news:<bhvk6a$mpf$1_at_nobel2.pacific.net.sg>...
I have to second Sybrand's concern, though. Why do you want to create
triggers on the fly via ODBC?
Justin Cave
> When I try to do that using ODBC, I get this error:
> Does anyone know how to use correlation names (:new and :old) through an
> ODBC connection?
> EG:
> CREATE TRIGGER Print_Cust_changes
> BEFORE INSERT ON CUST_tab
> FOR EACH ROW
> BEGIN
> dbms_output.put('Adding: ' || :new.custid);
> END;
My guess is that you're not escaping the colon (:). In ODBC :<foo>
indicates the presence of a bind variable.
> Server Msg: 24344, State: HY000, [Oracle][ODBC][Ora]
> Trigger, procedure or function created with PL/SQL compilation error(s).
>
> And if I try and Insert I get:
> Server Msg: 4098, State: HY000, [Oracle][ODBC][Ora]
> ORA-04098: trigger 'BCL.PRINT_CUST_CHANGES' is invalid and failed
> re-validation
>
> Of course the same code works perfectly in SQL*Plus...
Received on Thu Aug 21 2003 - 02:26:03 CEST