Subject RE: [firebird-support] Table name as parameter to stored procedure ?
Author sasha
>
> 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;
>

You're welcome.
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