Subject | Re: Dynamic Variable Instantiation Within A Stored Procedure |
---|---|
Author | Adam |
Post date | 2005-11-08T03:40:22Z |
--- In firebird-support@yahoogroups.com, "martinthrelly"
<martinthrelly@y...> wrote:
It is possible to split the input parameter into each word using
substring and a relatively simple while loop.
You can certainly return a record from the stored procedure for each
of these values if thats what you mean.
Output
======
bloggs
joe
brisbane
australia
If you wanted to use these values in a query of some sort, you could
join to the stored procedure from another stored procedure, or use
the execute statement syntax to build a dynamic query.
But you need to give a bit more info about what you want to do with
those values.
Adam
<martinthrelly@y...> wrote:
>there
> i am building a stored procedure to handle a database search. is
> any way i can take an input search string and create an array ofNot directly.
> strings from it by parsing for a ' ' delimiter. then afterwards
> dynamically create a variable for each item in the string array.
>
> example. say my SP receives the input search parameter "bloggs joe
> brisbane australia"
>
> somehow i want to dynamically create a variable
> for "bloggs", "joe", "brisbane" and "australia".
>
> thanks
>
It is possible to split the input parameter into each word using
substring and a relatively simple while loop.
You can certainly return a record from the stored procedure for each
of these values if thats what you mean.
Output
======
bloggs
joe
brisbane
australia
If you wanted to use these values in a query of some sort, you could
join to the stored procedure from another stored procedure, or use
the execute statement syntax to build a dynamic query.
But you need to give a bit more info about what you want to do with
those values.
Adam