OPENs and FOREACH
Posted in 1994
Topics: Stored Procedures & SPL
I have one of those it does work but the manual says it shouldn't type of questions. Consider the following sample code: database xxxx main define str CHAR(300) define name char(20) define dis_name like table.name let name = "PARKER" let str = "select name from table where name = ? " prepare command from str declare curs1 cursor with hold for command open curs1 using name foreach curs1 into dis_name display dis_name end foreach end main Of course you would change database and table names to work on your system. The above sample brings out all rows with the name "PARKER". The manual says that a FOREACH has an implied open and cannot be used with a sql statement that will require parameters. The OPEN section of the manual says the same thing. The program is running on HP 9000 / Online 5.0. I have also seen this code run on IBM RS/6000 Online 5.0? The real question is: Will I have any problems moving this code to earlier versions of Informix? ------------------------------------------------------------------------------- John Leipold | Duct tape is like The Force: jleip@csci.csc.com | It has a light side and a dark side, and Voice (303) 643-9802 | holds the universe together. FAX (303) 792-0319 | ------------------------------------------------------------------------------- DISCLAIMER: My opinions do not represent those of my employer, or reality for that matter. -------------------------------------------------------------------------------