Hi ,
I am using the mysql-connector-odbc-5.3.4-win32 to connect to MYSQL Server 5.5
I am calling a store procedure using the following ODBC Code Snippet.
I am getting Error “MySQL][ODBC 5.3(a) Driver][mysqld-5.5.19]Invalid parameter type".
Could you please give inputs on calling a store procedure using ODBC driver.
wstring wsStmt =L"{CALL `test`.`simpleproc7`(?)}";
RetCode = SQLPrepare(hStmt, (BSTR)(wsStmt.c_str()),wsStmt.length())
retcode = SQLBindParameter(hStmt, 1, SQL_PARAM_OUTPUT, SQL_C_CHAR, SQL_CHAR, 0, 0, &cParam1, 0, &cbParm2);
if ( (retcode != SQL_SUCCESS) && (retcode != SQL_SUCCESS_WITH_INFO) ) {
printf("SQLBindParameter(sParm1) Failed\n\n");
}else
{
if (hIpd)
{
SQLFreeHandle(SQL_HANDLE_DESC, hIpd);
hIpd = NULL;
}
retcode = SQLGetStmtAttr(hStmt, SQL_ATTR_IMP_PARAM_DESC, &hIpd, 0, 0);
if (retcode == SQL_SUCCESS)
{
retcode = SQLSetDescField(hIpd, 1, SQL_DESC_NAME,"param1",1);
}
}
RetCode = SQLExecute(hStmt);//
I am using the mysql-connector-odbc-5.3.4-win32 to connect to MYSQL Server 5.5
I am calling a store procedure using the following ODBC Code Snippet.
I am getting Error “MySQL][ODBC 5.3(a) Driver][mysqld-5.5.19]Invalid parameter type".
Could you please give inputs on calling a store procedure using ODBC driver.
wstring wsStmt =L"{CALL `test`.`simpleproc7`(?)}";
RetCode = SQLPrepare(hStmt, (BSTR)(wsStmt.c_str()),wsStmt.length())
retcode = SQLBindParameter(hStmt, 1, SQL_PARAM_OUTPUT, SQL_C_CHAR, SQL_CHAR, 0, 0, &cParam1, 0, &cbParm2);
if ( (retcode != SQL_SUCCESS) && (retcode != SQL_SUCCESS_WITH_INFO) ) {
printf("SQLBindParameter(sParm1) Failed\n\n");
}else
{
if (hIpd)
{
SQLFreeHandle(SQL_HANDLE_DESC, hIpd);
hIpd = NULL;
}
retcode = SQLGetStmtAttr(hStmt, SQL_ATTR_IMP_PARAM_DESC, &hIpd, 0, 0);
if (retcode == SQL_SUCCESS)
{
retcode = SQLSetDescField(hIpd, 1, SQL_DESC_NAME,"param1",1);
}
}
RetCode = SQLExecute(hStmt);//