As you find, you cannot use multiple lists of values ββin the same INSERT statement with Informix.
The simplest solution is to use several INSERT statements, each of which contains one list of values.
If you use an API such as ESQL / C and you are concerned about performance, you can create an INSERT cursor and reuse it. This saves the inserts until the buffer is full, or you close or close the cursor:
$ PREPARE p FROM "INSERT INTO mytmptable VALUES(?, ?, ?)"; $ DECLARE c CURSOR FOR p; $ OPEN c; while (...there more data to process...) { $PUT c USING :v1, :v2, :v3; } $ CLOSE c;
Variables v1 , v2 , v3 are host variables for storing strings and numbers to be inserted. (If necessary, you can use $ FLUSH c; in a loop.) Since it buffers values, it is pretty efficient. Of course, you could just use $ EXECUTE p USING :v1, :v2, :v3; in the loop; which also precedes the report for each row.
If you don't mind writing verbose SQL, you can use the UNION technique proposed by Matt Hamilton , but you will need a FROM clause in every SELECT with Informix, you can specify:
FROM "informix".systables WHERE tabid = 1 , orFROM sysmaster:"informix".sysdual , or- use another method to ensure that SELECT has a FROM clause but generates only one row of data.
In my databases, I have either a dual table with one row in it, or a synonym for dual , which is synonymous with sysmaster:"informix".sysdual . You can do without "informix". parts of these operators if the database is "normal"; owner name is crucial if your database is an ANSI Informix MODE database.