Re: help - input a search list from a form
Posted in 1996
mickm@netcom.com (Mickey Mestel) wrote: : 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 ... I would add a define: p_statement char(1000) # Or however large you need it. and use this to build your select statement: let p_statement = "select ...", "...", " and project_code in (", g_project_codes clipped, ")" and then use this to prepare and declare your cursor. Then of course your formonly field must be of type char. If this doesn't work you have some serious bug somewhere else. Of course it might have been much better for the user if you used an input array statement or some othe function to display a list of your projects, probably with clear text descriptions, and let them chose one or more from that list. It's too much to describe how to here, but take a look at www.iiug.org and you might find something usefull. : 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.