Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Pro*C and trigger

Re: Pro*C and trigger

From: lomba <news_at_pressemicro.net>
Date: Fri, 13 Dec 2002 20:46:14 +0100
Message-Id: <1039808767.16871.0@doris.uk.clara.net>


"Matthias Rogel" <rogel_at_web.de> a écrit dans le message de news: at41o7$vlnak$1_at_ID-86071.news.dfncis.de...

> Dan:
> great remark
> but, as far as I understand lomba, the program he wants to write is also
> a set-up program

You're totally right... My program has to initialize the "computer" and, after that, has to be used like a classical program.

> Do U have a hint for him in this case ? No :-(
I'm so sad ;-(

> lomba:
> you could try with the Pro*C construct EXECUTE IMMEDIATE
> (note there is also an execute immediate construct in PL/SQL, but I
> don't speak of this now)
>
> the Syntax is something like
> EXEC SQL EXECUTE IMMEDIATE :statement ;
> where statement is a character string host variable.
> (take a look at your Pro*C programmers guide)
>
> Does this work ?

I tried :
EXEC SQL EXECUTE IMMEDIATE " \
CREATE OR REPLACE TRIGGER trig_inser_insc \ BEFORE INSERT ON inscription \
FOR EACH ROW \
BEGIN
SELECT mysequence.nextval INTO :NEW.id FROM DUAL; \ END; \
";

And unfortunately, that doesn't work :(
Thank you for your answers !

--
lomba
Received on Fri Dec 13 2002 - 13:46:14 CST

Original text of this message

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