Subject Dynamic SQL statement in stored proc
Author Si Carter
Hi,

I am trying to pass a where clause to a stored procedure to be used in
a for..select statement, something like:

CREATE PROCEDURE WSP_INVOICEORDERS_PAGE (IPWHERECLAUSE VARCHAR(1000))
RETURNS (OPINVOICEID BIGINT)
AS
DECLARE VARIABLE vSQL VARCHAR(5000);
BEGIN
vSQL = 'SELECT a.ID FROM WS_INVOICE_ORDERS a ' || :IPWHERECLAUSE;

FOR :vSQL
INTO :OPINVOICEID
DO
BEGIN
SUSPEND;
END
END^

the above errors but hopefully you can see what I'm trying to do, any
help appreciated

regards

Si