Re: Re: [Solved] -- Re: RE: How do I pass a collection type to a prepared statement in [1836]
Posted in 2003
> " and field_color in (?, ?, ?, ?, ?, ?, ?, ?)",
I dind't like this approach 'cause if the list of colors grows I have to modify the query... I prefer the temporary table solution some mentioned instead...
>Why? How many colours are you likely to need to pass?
It's user configurable... so some time could be 3, other times 7... etc, the user decides...
> " where field_code = ? ", --dynamic
> " and field_color in (", c_col, ") ", --static-dynamic
>Except that you will have to PREPARE this every time
>you run a new query.
>It would be better for performance to PREPARE the
>cursor using one of the
>solutions mentioned before, then EXECUTE it as many
>times as you need.
You're rigth, but this time I have the luck on my side... the program I'm doing is a deamon (it never finish), and when it starts to execute the list of colors is fixed; so I managed to do what you describe... prepare it once one executing many times... wich have improved the response time ;) ;)
>>Anyway I think it is a fault that a collection
>>cannot be passed to preapred statement with Using.
>I guess there's not a lot of call for it. :-)
Yeah, it would be nicer... that's my problem with 4gl: Sometimes it doesn't do what I'm telling to do, even when it is supposed that it is somethig that work ;(
(For example didn't you know that you can't use the concatenation operator in a select inside a 4gl program... it is really funny it works on dbaccess but not in 4gl 7.30... luckyly i managed to workarround this)
Thanks for your time.
Chucho!
Jean Sagi
jeansagi@myrealbox.com
jeansagi@netscape.net
sending to informix-list