Subject Re: [firebird-support] How do you trim fetched char/varchar column?
Author Ann W. Harrison
Jeff Lynn wrote:
>
> In other commercial databse APIs that I used, the pSQLDA->sqllen
> contains the actual fetched data length returned. But in Firebird,
> this field returns the max. size of the column.
>
> Any idea?

Yes. The SQL standard says that char is fixed length and blank
filled. Use varchar instead. In the SQLDA, you can ask for
strings as CString, which is null terminated and will terminate
after the significant characters in the varchar. If you ask
for varchar, you get a two byte length of significant bytes, then
the string.


Regards,


Ann