Subject RE: [firebird-support] Parameters in Strored Procedure
Author Paul Mercea
You should use first one SP where u initialise PARAM1 and send after that to
your SP as param .

-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of majstoru
Sent: Friday, December 30, 2005 11:47 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Parameters in Strored Procedure

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!








++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Yahoo! Groups Links