Re: ESQL/C with structures?
Posted in 1991
Quoting TDC administration account... > > Is it possible to use Informix ESQL/C with structures? > In particular, I want to group together several host variables > (ie $strings, $ints etc) which are, together, a record. > > Actually, I basically want to get similar working to: > DEFINE abc ARRAY[20] OF RECORD LIKE table.* > and > DEFINE abc RECORD LIKE table.* > as in 4GL. > > What format or syntax should I use to get these in ESQL/C? > Although you can't do a "DEFINE RECORD LIKE" like you can in 4GL, you can do the following: $struct { char colname[19]; long tabid; short colno; short coltype; short collength; } syscolumns; The above structure is the ESQL/C equivelent for the "syscolumns" catalog. Note #1: Strings must be 1 byte larger than that defined in the table. Note #2: INTEGER types must be defined as "long" not "int". Note #3: SMALLINT types must be defined as "short" not "int". DAS -- David A. Snyder @ UE&C - Catalytic in Philadelphia, PA UUCP: ..!uunet!trac2000!das INTERNET: das@trac2000.ueci.com