Re: Informix C Interface
Posted in 1991
>> They only support embedded SQL and a pre-processor. The basic SQL commands
>> are pretty close to the ANSI standard for embedded SQL. There are also
>> commands for selecting the database you want, starting and stopping audits,
>> etc. They do not support direct C-Library calls, unfortunately. They
>> also support processing "dynamic SQL", meaning you can compile and execute
>> SQL statements at run time. What they have seems to work; I just wish it
>> was more flexible. You could try calling them up and asking for an
>> evaluation copy.
>>
>Assuming that you will never use Informix-ONLINE, there is Informix C-ISAM.
>These are C functions (usually /usr/lib/libisam.a) that access files
Oracle (for example) has a direct call interface that allows the C programmer
to process SQL statements like Informix; what it has in addition is the ability
to declare and use statement-ids and select cursors as host variables. The
inability to do this in Informix has caused me a lot of problems. What I can't
do is write a generic procedure for handling dynamic SQL when I have to worry
about having more than one SQL statement at a time; I have to write separate $
declare ...; $ open ...; and $ fetch ...; statements for each SQL statement (I
am developing an SQL interface for another language). What I would like to be
able to do is something like:
$cursor cur1[10];
$cursor *ptr;
ptr = cur1[3];
$ char selct_stmnt = "select * from mytable";
$ declare $ptr for $selct_stmnt;
$ open $ptr;
$ fetch $ptr using descriptor udesc;
but because the pre-processor insists on hard-wired constants for statement-ids
and select cursors I can't do the above example. C-ISAM won't help here
because I want to process SQL queries.
John