Subject | RE: [firebird-support] Table name as parameter to stored procedure ? |
---|---|
Author | sasha |
Post date | 2007-08-15T12:42:23Z |
>You're welcome.
> Thanks Sasha, your sugestion with EXECUTE STATEMENT solved my problem.
> Thanks also to Martijn Tonies.
>
> var_sttm='SELECT DISTINCT year,month FROM '||:pTBL
>
> FOR EXECUTE STATEMENT var_sttm INTO :year,:month DO BEGIN
> SUSPEND; END END;
>
I'm curious though, why do you need distinct month, year from unknown table?
If you have a couple of tables that have similar structure (month and year
columns) you could create a view and union all tables involved. I think it
should perform faster than executing statements in psql.
Sasha