Home » SQL & PL/SQL » SQL & PL/SQL » parameterized procedures
parameterized procedures [message #36427] Tue, 27 November 2001 10:07 Go to next message
Francis Ngula
Messages: 2
Registered: November 2001
Junior Member
Hello
I am trying to finish this simple procedure
What will I have to do with the parameter when I want the procedure to take all rows instead of the specified number of rows?

CREATE OR REPLACE PROCEDURE alex_new_draft (rows IN NUMBER) IS

CURSOR c_client IS
SELECT client_no, bal_due
FROM franco_tab;

str_client_no franco_tab.client_no%type;
new_bal franco_tab.bal_due%type;
v_freq NUMBER := 10;
v_counter NUMBER := 0;
num_of_rows NUMBER;
BEGIN
OPEN c_client;

LOOP
v_counter := v_counter +1;
FETCH c_client INTO str_client_no, new_bal;
IF MOD(v_counter, v_freq) = 0 THEN


COMMIT;
END IF;
INSERT INTO alex_new_tab
VALUES(str_client_no, new_bal);

EXIT when c_client%ROWCOUNT= rows;


END LOOP;
CLOSE c_client;

END;

----------------------------------------------------------------------
Re: parameterized procedures [message #36430 is a reply to message #36427] Tue, 27 November 2001 11:00 Go to previous messageGo to next message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
use exit when c_client%notfound

----------------------------------------------------------------------
Re: parameterized procedures [message #37988 is a reply to message #36427] Tue, 12 March 2002 13:15 Go to previous message
Soheil K
Messages: 1
Registered: March 2002
Junior Member
Hello My Student,

Look in the process books.
Previous Topic: Joining on Nonmatched Key
Next Topic: Re: SQL String Manipulation ?!
Goto Forum:
  


Current Time: Fri Apr 26 02:58:30 CDT 2024