Subject | Re: [ib-support] Working with arrays |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2002-09-10T03:00:07Z |
On 7 Sep 2002 at 21:37, Jaume Andreu Sabater Malondra wrote:
you can't use DSQL anywhere else), you can use NOT IN (<list of
values>).
DELETE FROM TABLE
WHERE (FIELD_A = :P_PARAM)
AND (','||P_LIST||',' NOT LIKE '%,'||CAST(FIELD_B AS VarChar)||',%');
If you add extra commas to P_LIST beforehand, you can make this
expression a bit simpler.
SY, Dimitry Sibiryakov.
>The stored procedure that does the work of deleting those rows,Constructing DSQL statement on the client side (as a matter of fact
>receives a varchar(255) with a list of comma separated integer values,
>in the form of "1,2,3" and so on. Let's call the parameter P_LIST.
>
>So, the only solutions it seems I have is to use DSQL to dynamically
>handle the comma sepparated values and add "AND (FIELD_B <> XX)"
>clausules to the statement. Then execute it.
you can't use DSQL anywhere else), you can use NOT IN (<list of
values>).
>Any hints on this? Is there any way to work with arrays or should IIf you really have to do this inside of stored proc, try this:
>just forget about arrays and try the DSQL way?
DELETE FROM TABLE
WHERE (FIELD_A = :P_PARAM)
AND (','||P_LIST||',' NOT LIKE '%,'||CAST(FIELD_B AS VarChar)||',%');
If you add extra commas to P_LIST beforehand, you can make this
expression a bit simpler.
SY, Dimitry Sibiryakov.