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: 25 Dec 2006 00:00:35 -0800
Message-ID: <1167033635.725271.97360@i12g2000cwa.googlegroups.com>


harun.bolat_at_netsim.net a écrit :
> hasta_l3_at_hotmail.com yazdı:
> > 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;
> >

> thanks,

>

> we already tested block label, but not worked.
>

May I know why ? Of course, you would have to enclose the translated trigger code in its own block, as in the code I gave...

> I think there is no solution. we have to change variable name.

Yes, that would be much better, if you can achieve it. By far...

Good luck

Received on Mon Dec 25 2006 - 02:00:35 CST

Original text of this message

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