Subject Re: [firebird-support] list of integers as a parameter
Author Alexandre Benson Smith
steve_carter_ben wrote:
> I'm using Delphi, IBObjects, and FB 1.5.
> I want to pass a list of integers as a parameter to a stored procedure
> (of course, I'll pass them as a comma-delimited string), and use them
> in something like: select ... where chord_id in(...) [meaning, in my
> list of values]
> In Oracle, I can do this with a table function; I can pass a string
> parameter like '1,3,5', and essentially put them in a table, so, in
> effect, I'm doing something like ...where chord_id in(select chord_id
> from chord_id_table).
>
> So, conceptually, what I want is to be able to call a seletable stored
> procedure: select tunes('1,3,5'), and the code in the procedure would
> be the equivalent of: select title from tunes where tunes.chord_id in
> (1,3,5).
>
> Suggestions?
>
> Steve
>
>
Hi Steve,

Two suggestions:
1.) Parse the string inside your SP, populate a temporary table, make a
join with that table.
2.) Use EXECUTE STATEMENT concatenating the parameter with a pre-defined
query string.

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br