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: declare variable in trigger

Re: declare variable in trigger

From: <hasta_l3_at_hotmail.com>
Date: 23 Dec 2006 21:35:30 -0800
Message-ID: <1166938530.254233.72360@48g2000cwx.googlegroups.com>


harun.bolat_at_netsim.net a écrit :
> we use firebird database and try to migrate project to oracle. All our
> database object( trigger, stored procedure) we use variable name same
> as database field name and we have no problem. using variable same as
> field name, makes code more readable.
> to migrate oracle from firebird we try to write convert program that
> takes firebird sql and produce oracle sql code.
>
> In oracle stored procedure we can use variable name same as field name
> like procedure_name.variable_name syntax. This syntax why not exists it
> trigger?

Perhaps block labels will help you - something like this little crazie :

CREATE OR REPLACE TRIGGER KULLANIC_BI BEFORE INSERT ON KULLANIC FOR EACH ROW
BEGIN
  <<KULLANIC_BI>>
  DECLARE
    NSUID INTEGER;
  BEGIN
    NSUID := 5;
    SELECT MAX(K.NSUID) AS F_1

         INTO NSUID
      FROM KULLANIC K

    WHERE K.NSUID = KULLANIC_BI.NSUID;
  END;
END; Best regards Received on Sat Dec 23 2006 - 23:35:30 CST

Original text of this message

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