char sqlstmt[1024 + 1]; /* SQL語句 */memset(sqlstmt, 0x00, sizeof(sqlstmt));sprintf(sqlstmt, "select %s from %s where %s", field, tablename, condition);/* 準備語句 */EXEC SQL PREPARE stmt FROM :sqlstmt;if (DB_RESULT_SUCC != sqlca.sqlcode ) { /* 錯誤處理 */}/* 宣告遊標 */EXEC SQL DECLARE cur_settle CURSOR FOR stmt; if (DB_RESULT_SUCC != sqlca.sqlcode ) { /* 錯誤處理 */} /* 開啟遊標 */EXEC SQL OPEN cur_settle; if (DB_RESULT_SUCC != sqlca.sqlcode ) { /* 錯誤處理 */}
char sqlstmt[1024 + 1]; /* SQL語句 */memset(sqlstmt, 0x00, sizeof(sqlstmt));sprintf(sqlstmt, "select %s from %s where %s", field, tablename, condition);/* 準備語句 */EXEC SQL PREPARE stmt FROM :sqlstmt;if (DB_RESULT_SUCC != sqlca.sqlcode ) { /* 錯誤處理 */}/* 宣告遊標 */EXEC SQL DECLARE cur_settle CURSOR FOR stmt; if (DB_RESULT_SUCC != sqlca.sqlcode ) { /* 錯誤處理 */} /* 開啟遊標 */EXEC SQL OPEN cur_settle; if (DB_RESULT_SUCC != sqlca.sqlcode ) { /* 錯誤處理 */}