{
/* handle error */
}
/* allocate a statement handle */
ret = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
if (ret != SQL_SUCCESS)
{
/* handle error */
}
/* execute statement 1 directly */
ret = SQLExecDirect(hstmt, stmt1, SQL_NTS);
if (ret != SQL_SUCCESS)
{
/* handle error */
}
/* fetch each row and display */
ret= SQLFetch(hstmt);
if(ret == SQL_NO_DATA_FOUND)
{
printf("No data found");
}
while(ret != SQL_NO_DATA_FOUND)
{
/* get data from column 1 */
ret = SQLGetData(hstmt,
1,
SQL_C_UBIGINT,
wk_id,
0,
4);
if (ret != SQL_SUCCESS)
{
/* handle error */
}
/* get data from column 2 */
ret = SQLGetData(hstmt,
1,
SQL_C_UBIGINT,
user_id,
15,
4);
if (ret != SQL_SUCCESS)
{
/* handle error */
}
ret=SQLFetch(hstmt);
210
MySQL to DB2 UDB Conversion Guide
footer
Our partners:
PHP: Hypertext Preprocessor Cheap Web Hosting
JSP Web Hosting
Ontario Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Java Hosting
Cheapest Hosting
Visionwebhosting.net Business web hosting division of Vision Web Hosting Inc.. All rights reserved