Subject Re: [firebird-support] strlen in retrieved char buffer
Author Kurt Federspiel
I traced through the code and discovered the
SQLDA->sqlvar[0]->sqltype is getting changed to 448
(SQL_VARYING) when the isc_dsql_prepare() is run. By
setting it back to 453 (SQL_TEXT + 1), I get the
correct output.

Can anyone explain why the prepare statement is
changing the data type?

Thanks.
Kurt.


--- federonline <federonline@...> wrote:

> Hi.
>
> I am querying a table for a list of references (the
> parent in a tree
> that views are used to access). When I run the
> query and the value is
> returned, the length of the returned string proceed
> the actual string.
> For example, if the Group string is 'UNIT1', the
> return value comes
> back '\5\0UNIT1\0\0...'
>
> In other queries I run, I get filler blanks (which I
> would prefer and
> can easily right-trim). So, how do I actually STOP
> this precursor of
> string length from happening??
>
> A snippet is below, and thanks in advance.
> Kurt Federspiel.
>
>
> memset( szStatement, 0, QUERY_LEN );
> strcat( szStatement, "select Groups from GROUPS " );
>
> SQLDA1 = (XSQLDA*)malloc( XSQLDA_LENGTH(1) );
> SQLDA1->version = 1;
> SQLDA1->sqln = 1;
>
> SQLDA1->sqlvar[0].sqldata = GRP;
> SQLDA1->sqlvar[0].sqltype = SQL_TEXT + 1;
> SQLDA1->sqlvar[0].sqllen = sizeof(GRP);
> SQLDA1->sqlvar[0].sqlind = &flag;
>
>
>




____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html