Re: Parameters in cursor declaration (was 'no subject')
From: Jurij Modic <jurij.modic_at_mf.sigov.mail.si>
Date: 1997/05/23
Message-ID: <338556CC.DC0EE805_at_mf.sigov.mail.si>#1/1
Date: 1997/05/23
Message-ID: <338556CC.DC0EE805_at_mf.sigov.mail.si>#1/1
CG wrote:
>
> Hi all,
>
> I'm trying to define a cursor as such,
>
> cursor cur_abc( table varchar2 )
> select cola from table
> where colb = '123';
>
> the question here is :
> is it legal to expect the variable (table) defined in cur_abc
> to refer to the table name I want to query ?
> (gives me some compilation errors)
> Thanks, Chris
No, it is not legal. Cursor parameters can appear in select statement wherewer you can use constant. You can not use constants in the FROM part of SELECT statement.
Dynamic SQL should solve your problem.
Regards,
-- =============================================================== ! Jurij Modic Republic of Slovenia ! ! tel: +386 61 178 55 14 Ministry of Finance ! ! fax: +386 61 21 45 84 Zupanciceva 3 ! ! e-mail: jurij.modic_at_mf.sigov.mail.si Ljubljana 1000 ! ===============================================================Received on Fri May 23 1997 - 00:00:00 CEST