switch between two cursors based on parameter passed into stored procedure
- by db83
Hi,
I have two cursors in my procedure that only differ on the table name that they join to.
The cursor that is used is determined by a parameter passed into the procedure
if (param = 'A') then
DECLARE CURSOR myCursor IS
SELECT x,y,z
FROM table1 a, table2 b
BEGIN
FOR aRecord in myCursor
LOOP
…