Subject | Re: How do you trim fetched char/varchar column? |
---|---|
Author | Jeff Lynn |
Post date | 2006-04-13T16:46:02Z |
--- In firebird-support@yahoogroups.com, "Ann W. Harrison"
<aharrison@...> wrote:
length text data returned from other databases null-terminate at the
max defined length, on top of blank fill the extra spaces. I simply
have to right trim the returned value.
jml
<aharrison@...> wrote:
>I may be wrong, but I seems to recall my other experience with fixed
> 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
>
length text data returned from other databases null-terminate at the
max defined length, on top of blank fill the extra spaces. I simply
have to right trim the returned value.
jml