Subject Re: Optional parameter in a select statement
Author m_formigoni
> Why can't you use it ? Is the command too long ? Or you want to use
> your original command unchanged ? Or ... ?

My original select has 5 optional parameters, I'd have 25 UNIONS.

> SELECT *
> FROM LogTable
> WHERE Usr STARTING :User AND (:User IN (Usr,''))
>
> (you have to use empty string '' to indicate the need to fetch all rows)

This above yes, that's what I was looking for!!

;
> > select 'select * from TABLE' from RDB$DATABASE into :command;
> > execute(command);
>
> Are you going to use it inside stored procedure ?

Yes, inside a SP.. Is there a way?