Click to See Complete Forum and Search --> : how to define a cursor in oracle stored procedure which using the parameter after processed?


January 6th, 2000, 02:35 AM
hello
this is a stored procedure:

CREATE OR REPLACE PACKAGE BODY sp1
AS
PROCEDURE sp
(INCode IN OUT NUMBER,
pCD IN VARCHAR2(4) )
IS
CURSOR customer IS
SELECT ...
FROM...
where... ;
BEGIN
FOR singlecustomer IN customer
....

now i want to define the cursor customer which the sql statement
is depend on the process of the parameter 'incode' and 'pcd',
but the cursor has to be declared in the head of procedure...

can anyone help me
thank you