How to Create procedure with Cursors, Input, Output
From: Rodger <rodger_at_infobahn.mb.ca>
Date: 1997/04/02
Message-ID: <334273EE.67FC_at_infobahn.mb.ca>#1/1
open ntsi;
fetch ntsi into var_ntsi_ref, var_ntsi_code; DBMS_OUTPUT.PUT_LINE(var_ntsi_ref || ' , ' || var_ntsi_code); close ntsi;
end ;
Date: 1997/04/02
Message-ID: <334273EE.67FC_at_infobahn.mb.ca>#1/1
[Quoted] April 2, 1997
I want to create a procedure. This procedure will have:
- input variable(s)
- output variable(s)
- a cursor within the procedure. I must be able to control the pointer movement in the cursor with Open, Close and Fetch statements.
What is aggravating is that I can get things to work in SQLPLUS, but I can't get them to work in PL/SQL.
IN SQLPLUS:
declare
CURSOR NTSI IS
Select
ntsi_ref,
ntsi_code
from agt_ntsi; var_ntsi_ref agt_ntsi.ntsi_ref%type; var_ntsi_code agt_ntsi.ntsi_code%type;begin
open ntsi;
fetch ntsi into var_ntsi_ref, var_ntsi_code; DBMS_OUTPUT.PUT_LINE(var_ntsi_ref || ' , ' || var_ntsi_code); close ntsi;
end ;
1234, the_result
PL/SQL procedure successfully completed.
PL/SQL:
[Quoted] However, trying to do similar things in PL/SQL will only give:
Warning: Procedure created with compilation errors.
How can I get the simple concept to work in reality?
Thanks in Advance. Received on Wed Apr 02 1997 - 00:00:00 CEST