Re: Informix Libraries for Unix?
Posted in 1994
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
In <2ittuu$566@schema.fiu.edu>, Jorge Castellano writes: >I am writing a C program on a Unix system that will be accessing and >writing to an informix database. Does anyone know of any libraries for >unix systems that have routines that will allow me to do exactly this? > >Any information will be greatly appreciated. acessing standard-informix databases regardless what backend, SE or Online, you use, is quite simple with esql/c. that's a product from informix, as expensive as any informix product. (yes, anyone@informix.com, your quality has it's price... :-) esql should be available for any unix the informix database is available for. esql/c means embedded sql, you just write your sql-statements in the c-program and they get precompiled before cc is called and linked with a special libray. that's all. a tiny example: #include <allmystuff.h> $include <sqlca.h> /* the $-sign is for esql/c */ int main(void) { $int number; /* c-program variable to take a */ /* field-value from the database. */ $open database phone; /* connect to the backend */ $select number into $number /* find my telephone number */ from phone where phone.name = "Martin"; if (sqlca.sqlerrd[2] = sqlnotfound) /* returncode: notfound */ printf("Martin's Number not found); else printf("Martin: %d\\n", number); $close database; return; } if you have i4gl, this may compile using c4gl. name your program something like 'dontknow.ec', and have a try. preprocessing (using #define's) is a bit tricky with esql, but it can be done. if you find an old version of informix 2.0, you ar lucky: esql is part of V2.0 (but ignoring ansi-c). since V2.1 you have to buy it seperately. martin -- _____________________________________________________________________________ Martin Brueggebors | using surfboards by F2, unix SVR4, C, red wine earth!europe!germany!hamburg | avoiding DOS, Windows, buttermilk