Re: Problem on SPL syntax in Informix 7.31
Posted in 2006
> -----Original Message-----
> From: Massoroto [mailto:alanmas@gmail.com]
> Posted At: Thursday, February 02, 2006 3:11 AM
> Posted To: comp.databases.informix
> Conversation: Problem on SPL syntax in Informix 7.31
> Subject: Problem on SPL syntax in Informix 7.31
>
>
> Hi,
>
> I've got a syntax problem on a Stored Procedure undert IDS 7.31. Is it
> possible to concatenate integers and put them into a varchar variable
> maintaining them as a uniqeu item? How? Are they canverted
> automatically to chars within thgelist? My code looks like something
> like this:
>
> DEFINE varList varchar(250);
> DEFINE varFirst smallint;
>
> LET varList = '';
> LET varFirst = 0;
>
> CREATE PROCEDURE TEST()>
> FOREACH
> SELECT var INTO varAux FROM table1
>
> IF (varFirst = 0) THEN
> LET varList = varAux;
> LET varFirst = 1;
> ELSE
> LET varList = varList || ',' || TRIM(varAux);
> END IF;
>
> END FOREACH;
>
> FOREACH
>
> SELECT value
> INTO valueAux
> FROM table2 WHERE value NOT IN (varList)
> order by 1 desc>
> END FOREACH
>
> END PROCEDURE;
>
>
> My problem is that when I execute the sentence:
>
> SELECT value
> INTO valueAux
> FROM table2 WHERE value NOT IN (varList)>
> varList is trated as a unique parameter (char) and not as a group of
> integers and this sentence returns always all the values. Any idea?
>
> Thank you for your help.
>
This looks like dynamic SPL, something you can't do.
I think this is more an application issue and could be rewritten to
avoid the need for dynamic spl
Paul Watson
Tel: +44 1414161772
Mob: +44 7818003457
GO FURTHER with DB2
GET THERE FASTER with Informix.
Attend the IDUG 2006 North America Conference.
Tampa, Florida, USA. 7-11 May 2006.
Visit http://www.iiug.org/conf for more information.