Re: help - input a search list from a form
Posted in 1996
Mickey, The problem is that the server expects a single value in the SELECT statement (look at the .c file to find the SELECT statement, and note the single question mark for the IN clause). You are providing a string which cannot be interpreted as a single number, and it is causing problems. You need to build the SELECT statement from a string, embedding the string value for g_project_codes into the IN clause, and then PREPARE it and DECLARE a cursor for it, etc. Of course, if you do that, then you should probably use CONSTRUCT to generate the WHERE clause for you because it allows more flexibility as you can specify ranges too, which would not be easy with your current scheme. Also, you should be using version 6.0x I4GL with 6.0x or later engines (with a possible exception if you are doing remote database access); the performance hit is significant. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> }From: mickm@netcom.com (Mickey Mestel) }Date: Thu, 13 Jun 1996 21:41:52 GMT }X-Informix-List-Id: <news.24971> } } i have a 4gl program that obtains it's search criteria from a }compiled form. i need to modify this so that i can get a list for an }IN clause in my program. in coding terms, i'm adding the line to my }query } } define g_project_codes char(100) } } select ... } ... } *and project_code in (g_project_codes) * } and ... } } the column project_code is an integer. i tried to set up a }character field on my screen that looks like this: } } Project Code [f003 ] } }f003 = formonly.g_project_code type integer; } } with the hopes of getting something like this from the user: } } Project code [1015, 1085, 1033 ] } } when i run the program, it bombs out with an error 407, which is }a communications error with the server: not all that useful. } } i have the program working if i declare my screen field and }variable as integer, but then i can only run the report for one project }at a time. not what i want... } } can anyone give me any hints as to how to do this? i'm running }version 4.12.UE3 of 4gl on sunos 4.1.4, and 7.13 of OnLine on solaris }2.4.