parameterized procedures [message #36427] |
Tue, 27 November 2001 10:07 |
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;
----------------------------------------------------------------------
|
|
|
|
|