Subject | Parameters in Strored Procedure |
---|---|
Author | majstoru |
Post date | 2005-12-30T09:47:14Z |
Hi,
I have a stored procedure which is read statements from table and
execute them, but in some cases I have param's in executed statements
and how can I pass param into the statement.
This is procedure:
BEGIN
FOR SELECT KNSQL, STSQL FROM KNJIZENJA WHERE TABLE = :TABLE AND TYPE
= :TYPE AND ACTIVE = 1
ORDER BY NUM INTO :KNSQL, :STSQL DO
BEGIN
IF (:EXECKN = 1) THEN
EXECUTE STATEMENT :KNSQL;
ELSE
EXECUTE STATEMENT :STSQL;
END
SUSPEND;
END
This is statement:
SELECT * FROM SOMETABLE WHERE ID = :PARAM1
Probmem is in PARAM1, how SP to know whicih is value to use for PARAM1
Thanks!
I have a stored procedure which is read statements from table and
execute them, but in some cases I have param's in executed statements
and how can I pass param into the statement.
This is procedure:
BEGIN
FOR SELECT KNSQL, STSQL FROM KNJIZENJA WHERE TABLE = :TABLE AND TYPE
= :TYPE AND ACTIVE = 1
ORDER BY NUM INTO :KNSQL, :STSQL DO
BEGIN
IF (:EXECKN = 1) THEN
EXECUTE STATEMENT :KNSQL;
ELSE
EXECUTE STATEMENT :STSQL;
END
SUSPEND;
END
This is statement:
SELECT * FROM SOMETABLE WHERE ID = :PARAM1
Probmem is in PARAM1, how SP to know whicih is value to use for PARAM1
Thanks!