Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC Stored Procedures

Status
Not open for further replies.

Crisps

Programmer
Sep 28, 2006
26
US
I would like to call a stored procedure VIA ODBC. The underlying ODBC connection may point to any database, but probably one of DB2, ORACLE, MSSQL or MYSQL.

Is there a means possible in C++ code to make a single call of the stored proc which will work for all of them. I have found so far you need to specify different statements for different products.

SQL

Code:
rc = SQLPrepare(hStatement, (SQLCHAR*)"EXEC TOPSCORE (?, ?)", SQL_NTS);

DB2

Code:
rc = SQLPrepare(hStatement, (SQLCHAR*)"CALL NULLID.TOPSCORE (?, ?);", SQL_NTS);

Thanks,
 
Since you are looking for a C++ statement, I suggest you post in a C++ forum on this site. Use the Find A Forum search.

-SQLBill

Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top