Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in executing stored procedure #89

Open
lys-st opened this issue Nov 28, 2020 · 0 comments
Open

Error in executing stored procedure #89

lys-st opened this issue Nov 28, 2020 · 0 comments

Comments

@lys-st
Copy link

lys-st commented Nov 28, 2020

When {call XX (?)} is spliced in the callprocedure asyncworker class, the character set in the string is not converted. ODBC needs the string of utf16, but gives the string of utf8。
code:
// create the statement to call the stored procedure using the ODBC Call escape sequence:
// need to create the string "?,?,?,?" where the number of '?' is the number of parameters;
SQLTCHAR *parameterString = new SQLTCHAR255;

  for (int i = 0; i < data->parameterCount; i++) {
    if (i == (data->parameterCount - 1)) {
      strcat((char *)parameterString, "?"); // for last parameter, don't add ','
    } else {
      strcat((char *)parameterString, "?,");
    }
  }

  data->deleteColumns(); // delete data in columns for next result set

  data->sql = new SQLTCHAR[255]();
  sprintf((char *)data->sql, "{ CALL %s (%s) }", combinedProcedureName, parameterString);
clach04 pushed a commit to clach04/node-odbc__DO_NOT_USE that referenced this issue Dec 17, 2020
Fix build warnings

Fixes wankdanker#88

Signed-off-by: Mark Irish <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant