Re: ESQL/C dynamic update problem
Posted in 1995
>Date: Mon, 7 Aug 95 11:49 PDT >From: cse@wetware.com (Scott Ellard) > >In article <405jb8$nu0@cssun.mathcs.emory.edu> you write: >>The DESCRIBE does not give you the details of the parameters of an UPDATE >>statement. It only ever gives you the description of the output data from >>the database, which means that only two statements ever have descriptions >>returned: SELECT and EXECUTE PROCEDURE. And even for these, you do not get >>a description of the input parameters! Consider: > >Hi Jonathan, Add INSERT to that list. Scott. I stand corrected -- SELECT, EXECUTE PROCEDURE and INSERT get sqlda structures after PREPARE and DESCRIBE. See the test code below, and the output. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> #include <stdio.h> #include <sqlda.h> main() { struct sqlda *p_sqlda; EXEC SQL DATABASE stores; printf("sqlca.sqlcode = %ld\\n", sqlca.sqlcode); EXEC SQL PREPARE p_insert FROM "INSERT INTO Customer(Customer_num) VALUES(?)"; printf("sqlca.sqlcode = %ld\\n", sqlca.sqlcode); EXEC SQL DESCRIBE p_insert INTO p_sqlda; printf("sqlca.sqlcode = %ld\\n", sqlca.sqlcode); printf("sqlda.sqld = %ld\\n", p_sqlda->sqld); return(0); } sqlca.sqlcode = 0 sqlca.sqlcode = 0 sqlca.sqlcode = 6 sqlda.sqld = 1