ESQL/C: reading in to a structure
Posted in 1993
Suma Vasudevan — — source: Informix-list mailing list archive (1991-1998)
This must be a naive question, but I would appreciate if some one
help me with this.
How do I read a sql query response to a C lang. structure?
For eg. if I have a table t with { x int, y varchar(40), z char(20)}
In my prorgam if I execute a query "select * from t " using a cursor
how do I read it in to C structure defined as:
$ struct t_rec { int x; char y[40]; char z[20] } ;
What I do now is to define,
$ int x; $char y[40]; $ z[20];
and fetch t_curs into x, y, z;
But I want to use is
$ struct t_rec t_rec_struct ;
$ fetch qid t_curs t_rec_struct;
Thanks in advance.
SV