1. Executing stored procedures via ODBC
I'm having a problem executing a stored procedures via ODBC. I'm certain
the stored procedure is being invoked, however, my input and output
parameters are being passed back and forth. I use SQLBindParameter function
for the mapping (see below). Any Ideas why this wouldn't work?
Thanks for your help,
Massis
virtual UERROR open(
void*& pVoid, // returned file identifier for future I/O calls,
implementation defines contents
const char* pName, // name of file to open
IORESULTCODE& nResultCode) // return codes:
// IORC_THEN - file opened ok
// IORC_ELSE - file not found
// IORC_ERROR - IO failed for some other reason.
{
char errmsg[1024];
char sqlStmt[] = "{call MVOpen(?, ?)}";
SQLHSTMT hstmt;
char fileptr[256];
long nNameLen = 0;
long nResultLen = 0;
long nFilePtrLen = 0;
long nClassNameLen = 0;
int rcode = 0;
// obtain statement handle to execute stored procedure
rcode = SQLAllocHandle(SQL_HANDLE_STMT, m_db->hdbc1(), &hstmt);
rcode = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR,
SQL_VARCHAR,
strlen(pName), 0, (void *) pName, 0, &nNameLen);
rcode = SQLBindParameter(hstmt, 2, SQL_PARAM_OUTPUT, SQL_C_CHAR,
SQL_VARCHAR,
sizeof(fileptr), 0, fileptr, 0, &nFilePtrLen);
// Execute the statement.
rcode = SQLExecDirect(hstmt, (unsigned char *) sqlStmt, SQL_NTS);
ProcessLogMessages(SQL_HANDLE_STMT, hstmt, errmsg, true);
rcode = SQLFetch(hstmt);
ProcessLogMessages(SQL_HANDLE_STMT, hstmt, errmsg, true);
SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
nResultCode = IORC_ON_ERROR;
return UE_NOERROR;
}
2. Variable parameter types - dB structure
3. Problem executing stored procedure with ODBC
4. Unique member names
5. sql2ksp3 upgrade: Error executing stored procedure via ODBC
6. Using a separate numeric quarter and year to delimit a question
7. VB execute stored procedure via ODBC to SQL SVR 7.0
8. Performance of dedicated server!
9. Empty output parameters when executing stored procedure through ODBC
10. Executing stored procedures via ODBC
11. Executing a Stored Procedure in a Stored Procedure and selecting on the result
12. executing system stored procedures within a stored procedure
13. Executing stored procedure from another stored procedure.