Re: 4gl SELECT Statement Woes
Posted in 1996
"Billy Wheeler" — — source: Informix-list mailing list archive (1991-1998)
On 28 Dec 96 at 21:27, John Cokos wrote:
> Help....
>
> Why doesnt this work:
>
> INPUT BY NAME cStuff
Firstly, cStuff must be a CHAR.
> { User will type in the following: 500,400,300 }
>
> SELECT count(*) INTO nCount FROM customers
> WHERE cust_no IN(cStuff)
If you PREPAREd and FETCHed this it should work, i.e.:
LET sqlStmt = "SELECT COUNT(*) FROM customers WHERE cust_no IN (",
cStuff CLIPPED, ")"
PREPARE exStmt FROM sqlStmt
OPEN exStmt
FETCH exStmt INTO nCount
> IF nCount > 0 THEN
> ERROR "Duplicate Customer Number Found!"
> END IF
HTH.
--
Ciao,
Billy
I'd be in favour of apathy, but I just couldn't be bothered...