Skip to content

Error in executing stored procedure #89

@lys-st

Description

@lys-st

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions