Subject strlen in retrieved char buffer
Author federonline
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;