Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: cursor using select from subquery
Starting 7.2 it is perfectly legal to use subquery in FROM clause
both in SQL and PL/SQL. I have 7.3 and I am using it in a lot of
my packages. I have many cursors declared similar as yours and
they compile OK. There is a bug (bug# 433341) in PL/SQL (it is
there since 7.2 and ORACLE still did not come up with a fix yet):
when you reference PL/SQL variable in a FROM clause subquery it
errors out with a
PLS-00320: the declaration of the type of this expression is
incomplete or malformed.
It seems like not your case. What is the exact ORACLE error you
are getting and what is the exact text of your stored procedure?
ORACLE syntax errors are in many cases very tricky: e.g. SQL below
is missing a comma between Z and Quot_Line_Item, although the
error points to ( :
select 1 from quote (select * from quote) Z Quote_Line_Item;
*
Solomon.Yakobson_at_entex.com
In article <32F0F4E5.1D6F_at_infosoft.be>,
"Gerard H. Pille" <ghp_at_infosoft.be> wrote:
>
> I have a select that works fine:
> select aup.usid, aup.program, obj.object_name
> from (select usid, program
> from users, programs ) aup,
> program_objects obj
> where obj.program = aup.program;
>
> However, if I want to use this query with a cursor within a
> stored procedure:
>
> cursor c_usprobj is
> select aup.usid, aup.program, obj.object_name
> from (select usid, program
> from users, programs ) aup,
> program_objects obj
> where obj.program = aup.program;
>
> the stored procedure gives compilation errors on the first "(".
>
> Does anybody know what's wrong? Is it not allowed to use
> selects from subqueries in PL/SQL?
>
> Kind reGards,
> \ / |
> x s
> / \
> Gerard
-------------------==== Posted via Deja News ====----------------------- http://www.dejanews.com/ Search, Read, Post to UsenetReceived on Tue Feb 04 1997 - 00:00:00 CST