Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Jonathan Leffler — — source: Informix-list mailing list archive (1991-1998)
}Date: Wed, 2 Mar 94 20:19 GMT
}From: dlima@tcsernet.tcs.ernet.in
}Subject: using SQLDA in ESQL/C gets (n-1) from char(n) field
}X-Informix-List-Id: <list.3603>
}
}When I use the SQLDA structure in a program to retrieve
}a database table field whose type is char(n), only
}n-1 characters are actually retrieved!
}
}The problem is most severe with n=1 or a field type char(1).
}
}I am acessing the sqlvar.sqldata and sqlda.
}sqlvar.sqllen members of the sqlda structure with sqltype=SQLCHAR.
}
}The memory allocated in the program is for (sqlvar.sqllen+1) bytes
}to the sqlvar.sqldata pointer.
}
}This was reported to Tech Support as 266450 who indicated that
}the table field should be made char(2) instead. That is
}not acceptable in my application.
Why?
}Does anyone have any clues? I use ESQL/C that comes with INFORMIX5.0.
Convert the type from SQLCHAR to CFIXCHAR.
Yours tersely,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.