It is well known that I can use an ODBC to connect to the database with an ODBC in Windows to perform corresponding data changes. But how do I write a program under UNIX to read and write a database? In fact, my door can be used in ESQL. He is the stuff in the IE editor under UNIX. For example, to write a code file, my door can be called Test.ec, (ESQL suffix is * .ec,) it compile The format is esql -o test test.ec. The following is Test.ec content: / * Test.ec * / # include
Main () {EXEC SQL include Sqlca; / * Define communication area * /
EXEC SQL BEGIN DECLARE Section; / * Main Variable Definition Start * / EXEC SQL End Declare Section; / * Main Variable Definition End * / EXEC SQL DROP Database EXAMPLE; EXEC SQL CREATE DATABASE EXAMPLE; EXEC SQL Database EXAMPLE; / * Connection Database * / if (Sqlcode == 0) {EXEC SQL CREATE TABLE Student (ALARM CHAR (6), SNAME CHAR (10));
} EXEC SQL INSERT INTO Student Values ("AAAA", "BBBB");
Return (0);} The above code is debugged under UNIX (Solaris, AIX, SCO), and then not pass, please install Informix first. QQ: 29921374, welcome to discuss! ! ! ! !