Unicode and Calling SQL Stored Procedures

bunni

Member
We are upgrading from 8.0 to 8.12 running on a SQL database. For this we have several custom business functions which call SQL Stored Procedures using ODBC connections.

After the merge we had to make a few changes in order to get the unicode to properly connect, bind, and execute the stored procedures.

At this point, everything is working except the output parameters will not return values like they did in 8.0. Although this may not be the only place to look for issues, I've been focusing on the bind parameter line. Does anyone have any ideas on what the syntax for the output parameters should look like for 8.12?

The 8.0 output parameter bind looked like this:

retcode =SQLBindParameter(StatementHandle, 8 , SQL_PARAM_OUTPUT, SQL_C_CHAR, SQL_VARCHAR,
sizeof(szBNVoucherNumber), 0, szBNVoucherNumber, sizeof(szBNVoucherNumber), &StrLen_or_IndPtr);

I've tried a number of variations on the syntax with no luck, but here is where I am at now:

lena = 16 * sizeof(JCHAR);

retcode =SQLBindParameter(StatementHandle, 8 , SQL_PARAM_OUTPUT, SQL_C_WCHAR, SQL_WVARCHAR,
DIM(szBNVoucherNumber), 0, szBNVoucherNumber, lena, &StrLen_or_IndPtr);

Thanks,
Nicole
 
We've resolved the issue. There was a trigger on one of the files the stored procedure wrote into. The output parameters now return the expected values with the following syntax we started with:

retcode =SQLBindParameter(StatementHandle, 8 , SQL_PARAM_OUTPUT, SQL_C_WCHAR, SQL_WVARCHAR,
DIM(szBNVoucherNumber), 0, szBNVoucherNumber, sizeof(szBNVoucherNumber), &StrLen_or_IndPtr);

Thanks,
Nicole
 
Back
Top