Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SELECT INTO and EXECUTE IMMEDIATE question
Pavel Vetesnik wrote:
> Hello,
>
> I have probably stupid question, but I really don't know how to fix this:
>
> Using simple SELECT in EXECUTE IMMEDIATE statement works fine, But if I try
> code like this, I get an error message:
> ---------------
> cSQL_Statement:='SELECT heslo FROM el_cas_psh WHERE id=2 INTO cOblast';
>
> EXECUTE IMMEDIATE cSQL_Statement
> ---------------
>
> Problem is the INTO clause. This SQL statement returns only 1 row and the
> cOblast is also declared.
>
> Please can you help me with it?
>
> TIA,
> Pavel
>
>
try
cSQL_Statement:='SELECT heslo FROM el_cas_psh WHERE id=2';
EXECUTE IMMEDIATE cSQL_Statement INTO cOblast;
this should work at least for trunc(oracleversion) >= 9 Received on Fri Dec 06 2002 - 08:44:08 CST
![]() |
![]() |