Hi,
Stored procedure has loop, cursor,do while,if else etc condition.
There are lots of sample stored procedures in net.
Examples below are some snippets of code
CREATE PROCEDURE abc (
OUT parm1 INTEGER,
IN parm2 CHAR(13),
......
)
DECLARE hNumber INTEGER;
L1: LOOP
---Your select
IF (CHECKING) THEN
LEAVE L1;
END IF;
END LOOP L1;
FOR emp1 AS emp_det CURSOR FOR
your select ....
DO
Your DML...
END FOR;
You can think of a nested loop and check the condition.
You can call a stored procedure recursively.
Maybe you can try so that you can get the feel.
Cheers,
Raja
Hi,
Stored procedure has loop, cursor,do while,if else etc condition.
There are lots of sample stored procedures in net.
Examples below are some snippets of code
CREATE PROCEDURE abc (
OUT parm1 INTEGER,
IN parm2 CHAR(13),
......
)
DECLARE hNumber INTEGER;
L1: LOOP
---Your select
IF (CHECKING) THEN
LEAVE L1;
END IF;
END LOOP L1;
FOR emp1 AS emp_det CURSOR FOR
your select ....
DO
Your DML...
END FOR;
You can think of a nested loop and check the condition.
You can call a stored procedure recursively.
Maybe you can try so that you can get the feel.
Cheers,
Raja