Script fails to be parsed properly
Posted: Thu 22 May 2008 12:31
The below script is executed as a whole instead of 3 statements:
I started out with a CREATE PACKAGE on top of the script as well, and this also failed. Previous code:
Got a clue why this fails?
--
Martijn Tonies
Upscene Productions
Code: Select all
create or replace procedure cursor_test1( p_deptno IN number
, p_cursor OUT
REFCURSOR_PKG.WEAK8i_REF_CURSOR)
as
begin
open p_cursor FOR
select *
from emp
where deptno = p_deptno;
end cursor_test1;
/** From Oracle 9 */
create or replace procedure cursor_test2( p_deptno IN number
, p_cursor OUT SYS_REFCURSOR)
as
begin
open p_cursor FOR
select *
from emp
where deptno = p_deptno;
end cursor_test2;
/* Strong type */
create or replace procedure cursor_test3( p_deptno IN number
, p_cursor OUT REFCURSOR_PKG.STRONG_REF_CURSOR)
as
begin
open p_cursor FOR
select *
from emp
where deptno = p_deptno;
end cursor_test3;Code: Select all
create or replace package REFCURSOR_PKG as
TYPE WEAK8i_REF_CURSOR IS REF CURSOR;
TYPE STRONG_REF_CURSOR IS REF CURSOR RETURN EMP%ROWTYPE;
end REFCURSOR_PKG;
/** until Oracle 9 */
create or replace procedure test( p_deptno IN number
, p_cursor OUT
REFCURSOR_PKG.WEAK8i_REF_CURSOR)
is
begin
open p_cursor FOR
select *
from emp
where deptno = p_deptno;
end test;
/** From Oracle 9 */
create or replace procedure test( p_deptno IN number
, p_cursor OUT SYS_REFCURSOR)
is
begin
open p_cursor FOR
select *
from emp
where deptno = p_deptno;
end test;
/* Strong type */
create or replace procedure test( p_deptno IN number
, p_cursor OUT REFCURSOR_PKG.STRONG_REF_CURSOR)
is
begin
open p_cursor FOR
select *
from emp
where deptno = p_deptno;
end test;--
Martijn Tonies
Upscene Productions