Worked a treat thanks :-) On 16 September 2011 12:09, Markus Ostenried <[email protected]> wrote:
> ** > > > On Fri, Sep 16, 2011 at 12:42, Si Carter <[email protected]> wrote: > > Hi, > > > > I am trying to pass a where clause to a stored procedure to be used in > > a for..select statement, something like: > > You're looking for EXECUTE STATEMENT. > See here: > http://www.firebirdsql.org/refdocs/langrefupd15-psql-execstat.html > > Example from > \Firebird_2_1\doc\sql.extensions\README.execute_statement.txt > > CREATE PROCEDURE DynamicSampleThree (TextField VARCHAR(100), TableName > VARCHAR(100)) > RETURNING_VALUES (Line VARCHAR(32000)) > AS > DECLARE VARIABLE OneLine VARCHAR(100); > BEGIN > Line = ''; > FOR EXECUTE STATEMENT 'SELECT ' || TextField || ' FROM ' || TableName > INTO :OneLine > DO > IF (OneLine IS NOT NULL) THEN > Line = Line || OneLine || ' '; > SUSPEND; > END > > HTH, > Markus > > > [Non-text portions of this message have been removed] ------------------------------------ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Visit http://www.firebirdsql.org 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 <*> To visit your group on the web, go to: http://groups.yahoo.com/group/firebird-support/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/firebird-support/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
