Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Sub-query in Oracle cursor
I'm trying to create a cursor with a subquery and this seems to upset
Oracle...
The following snippet shows what I'm trying to do.
CREATE OR REPLACE PROCEDURE PRC_MyTest AS
CURSOR MyCursor IS
SELECT
(SELECT COUNT(*) FROM Table1) MyCount ,
Column1,
Column2
FROM Table1;
BEGIN
return;
END;
The procedure compiles when I take out the line "(SELECT COUNT(*) FROM
MyTable) MyCount ,"
Executing the SQL below, in isolation from the procedure also works fine from the command line
SELECT (SELECT COUNT(*) FROM Table1) MyCount,
Column1,
Column2
FROM Table1;
Any ideas of what the problem is and any solutions will save my sanity and hence will be most appreciated.
Thanks Received on Fri Aug 09 2002 - 06:01:47 CDT
![]() |
![]() |