Hi,
I hope this subject isn't too confusing!
I am trying to excute the following
This generates the error
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
begin declare end exception exit for goto if loop mod null
pragma raise return select update while <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql execute commit forall
<a single-quoted SQL string>
It seems like I cannot use the order by clause in the subquery when it is used for a cursor, however if i just run the query
in SQL-Plus it executes without a problem.
Can anyone explain why this happens and hopefully provide a work-aroud?
Thanks very much for your time,
Michal
I hope this subject isn't too confusing!
I am trying to excute the following
Code:
DECLARE
CURSOR p_cursor1 IS
SELECT rownum,z.*
FROM
(SELECT 'hello','world' FROM DUAL ORDER BY 1) z;
BEGIN
OPEN p_cursor1;
CLOSE p_cursor1;
END;
This generates the error
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
begin declare end exception exit for goto if loop mod null
pragma raise return select update while <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql execute commit forall
<a single-quoted SQL string>
It seems like I cannot use the order by clause in the subquery when it is used for a cursor, however if i just run the query
Code:
SELECT
ROWNUM,z.*
FROM
(SELECT 'hello','world' FROM DUAL ORDER BY 1) z
Can anyone explain why this happens and hopefully provide a work-aroud?
Thanks very much for your time,
Michal