MySQL Forums
Forum List  »  Connector/ODBC

Calling Store procedure using the CALL is not returning expected output
Posted by: Karthick perumal
Date: September 04, 2015 08:40AM

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

Options: ReplyQuote


Subject
Written By
Posted
Calling Store procedure using the CALL is not returning expected output
September 04, 2015 08:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.