Home » SQL & PL/SQL » SQL & PL/SQL » Procedure Error
Procedure Error [message #37756] Tue, 26 February 2002 21:53 Go to next message
Liquido
Messages: 4
Registered: February 2002
Junior Member
Hi, i was trying this code on the sqlplus..
and receiving error that the procedure is created with compilation error,
what is wrong ?

CREATE OR REPLACE PACKAGE GetRecords AS
TYPE t_cursor IS REF CURSOR ;

Procedure OpenCursor (io_cursor IN OUT t_cursor);
END GetRecords;
/

CREATE OR REPLACE PACKAGE BODY GetRecords AS
Procedure OpenCursor (io_cursor IN OUT t_cursor, stmt in varchar(500))
IS
v_cursor t_cursor;
BEGIN
OPEN v_cursor FOR stmt;
io_cursor := v_cursor;
END OpenCursor;
END GetRecords;
/
Re: Procedure Error [message #37769 is a reply to message #37756] Wed, 27 February 2002 04:07 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
there was a mismatch between package declaration and package body. see the line marked with *** and compare with your code

CREATE OR REPLACE PACKAGE GetRecords AS
TYPE t_cursor IS REF CURSOR ;
***Procedure OpenCursor (io_cursor IN OUT t_cursor, stmt in varchar2);
END GetRecords;
/

CREATE OR REPLACE PACKAGE BODY GetRecords AS
***Procedure OpenCursor (io_cursor IN OUT t_cursor, stmt in varchar2)
IS
v_cursor t_cursor;
BEGIN
OPEN v_cursor FOR stmt;
io_cursor := v_cursor;
END OpenCursor;
END GetRecords;
/
Previous Topic: very urgent.. how to increase the performance for the insert statement
Next Topic: Select from 2 tables
Goto Forum:
  


Current Time: Fri Apr 26 09:26:27 CDT 2024