eric07
asked on
How to return these variables
I would like to create a function like this which works on sql api:
char szName[10];
int nCount;
...
SQLBindCol( hStmt, 1, SQL_C_CHAR, szName, sizeof( szName ), NULL );
SQLBindCol( hStmt, 2, SQL_LONG, &nCount, 0, NULL );
SQLFetch( ... );
The variables szName & nCount is not assigned until SQLFetch() is called. How is the function able to send this values back to me? Can someone write a small sample for the two on how it does this.
Thanks
char szName[10];
int nCount;
...
SQLBindCol( hStmt, 1, SQL_C_CHAR, szName, sizeof( szName ), NULL );
SQLBindCol( hStmt, 2, SQL_LONG, &nCount, 0, NULL );
SQLFetch( ... );
The variables szName & nCount is not assigned until SQLFetch() is called. How is the function able to send this values back to me? Can someone write a small sample for the two on how it does this.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
.
SQLBindCol( hStmt, 2, SQL_LONG, &nCount, 0, NULL );
SQLFetch( ... );
Thanks