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

Re: Troublesome Trigger

From: Ganesh Raja <ganesh_at_gtfs-gulf.com>
Date: 3 Feb 2002 01:54:53 -0800
Message-ID: <a8aed4.0202030154.18a8be29@posting.google.com>


"William O'Neill" <wfoneill_at_mindspring.com> wrote in message news:<a3hmk8$mgq$1_at_nntp9.atl.mindspring.net>...
> Am using Oracle9i(Enterprise) on WIN2K with Powerbuilder 8.0.1. Am trying
> to create this trigger which basically inserts data into an audit table,
> based on inserting a new record into the SERVICE table. Here is a fragment
> of my trigger:
> CREATE OR REPLACE TRIGGER trg_service_service_audit_log
>
> AFTER INSERT OR UPDATE OR DELETE ON service
>
> FOR EACH ROW
>
> DECLARE
>
> StatementType CHAR(1);
>
> var_serv_id NUMBER;
>
> var_service CHAR(4);
>
> BEGIN
>
> IF INSERTING THEN
>
> StatementType := 'I';
>
> Select seq_service_serv_id.currval into :=var_serv_id from dual;

is This is a Typo... Check that := before after the into Clause...
>
> Select to_char(seq_service_serv_id.currval) into :=var_service from dual;
>
>
>
> Insert into service_audit_log
>
>
> VALUES(seq_service_audit_log_log_no.nextval,var_serv_id,
>
> :new.serv_name,var_service,
>
> :new.servtype,:new.street1,
>
> :new.street2,:new.town,:new.state,:new.zipcode,:new.region,
>
> :new.district,:new.phone,:new.cont1_title,:new.contact1,
>
> :new.contact2,:new.contact3,:new.contact4,:new.contact5,
>
> :new.rec_hosp,:new.lic_exp,:new.transport,sysdate,
>
> sysdate,:new.user_id,:new.emr_phone,:new.archive,:new.user_id,sysdate,
>
> StatementType);
>
> Keep getting a compile error, eg. "Invalid SQL Statement." Any ideas...

Regards,
Ganesh R Received on Sun Feb 03 2002 - 03:54:53 CST

Original text of this message

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