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: Using dynamic PL/SQL in trigger.

Re: Using dynamic PL/SQL in trigger.

From: bhogak <bhogak_at_yahoo.com>
Date: 8 Mar 2003 16:51:53 -0800
Message-ID: <aaeddddb.0303081651.cac92e9@posting.google.com>


In my example, :new.test_column is not a literal..I am storing its value in the variable. So dyn sql will not treat it as a bind variable.
bhogak
Rene Nyffenegger <rene.nyffenegger_at_gmx.ch> wrote in message news:<b4cjme$1uaqv7$1_at_ID-82536.news.dfncis.de>...
> > I too don't understand why you are doing this....but you can give the
> > following a shot:
> >
> > v_sqlString := 'BEGIN IF '||:NEW.TEST_COLUMN||' IS NULL THEN RAISE COLUMN_IS
> > NULL; END IF;';
>
>
> How do you think is this different from the OP's string?
>
> Rene
>
>
> >
> > execute immediate v_sqlString;
> > -bhogak
> >
> > Gary <gary4work_at_hotmail.com> wrote in message
> > news:5128431b.0303071208.1add6299_at_posting.google.com...
> >> In my trigger, I have a code that generates a dynamic pl/sql block
> >> that contains the following:
> >>
> >> "begin if :new.test_column is null then raise column_is null; end if;
> >> end;"
> >>
> >> When I execute is code using the execute immediate command, I get an
> >> error because there is a bind variable expected.
> >>
> >> Is there anyway to escape the ':' character so that this code will
> >> execute like normal pl/sql?
> >>
> >> Thanks for any useful help.
> >
> >
Received on Sat Mar 08 2003 - 18:51:53 CST

Original text of this message

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