本文整理汇总了C++中SC_clear_error函数的典型用法代码示例。如果您正苦于以下问题:C++ SC_clear_error函数的具体用法?C++ SC_clear_error怎么用?C++ SC_clear_error使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SC_clear_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SQLExtendedFetch
RETCODE SQL_API
SQLExtendedFetch(
HSTMT hstmt,
SQLUSMALLINT fFetchType,
SQLLEN irow,
#ifdef WITH_UNIXODBC
SQLROWSETSIZE *pcrow,
#else
SQLULEN *pcrow,
#endif /* WITH_UNIXODBC */
SQLUSMALLINT *rgfRowStatus)
{
RETCODE ret;
StatementClass *stmt = (StatementClass *) hstmt;
mylog("[SQLExtendedFetch]");
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
StartRollbackState(stmt);
#ifdef WITH_UNIXODBC
{
SQLULEN retrieved;
ret = PGAPI_ExtendedFetch(hstmt, fFetchType, irow, &retrieved, rgfRowStatus, 0, SC_get_ARDF(stmt)->size_of_rowset_odbc2);
if (pcrow)
*pcrow = retrieved;
}
#else
ret = PGAPI_ExtendedFetch(hstmt, fFetchType, irow, pcrow, rgfRowStatus, 0, SC_get_ARDF(stmt)->size_of_rowset_odbc2);
#endif /* WITH_UNIXODBC */
stmt->transition_status = STMT_TRANSITION_EXTENDED_FETCH;
ret = DiscardStatementSvp(stmt, ret, FALSE);
LEAVE_STMT_CS(stmt);
return ret;
}
示例2: SQLFetch
RETCODE SQL_API
SQLFetch(HSTMT StatementHandle)
{
CSTR func = "SQLFetch";
RETCODE ret;
StatementClass *stmt = (StatementClass *) StatementHandle;
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
StartRollbackState(stmt);
#if (ODBCVER >= 0x0300)
if (SC_get_conn(stmt)->driver_version >= 0x0300)
{
IRDFields *irdopts = SC_get_IRDF(stmt);
ARDFields *ardopts = SC_get_ARDF(stmt);
SQLUSMALLINT *rowStatusArray = irdopts->rowStatusArray;
SQLLEN *pcRow = irdopts->rowsFetched;
mylog("[[%s]]", func);
ret = PGAPI_ExtendedFetch(StatementHandle, SQL_FETCH_NEXT, 0,
pcRow, rowStatusArray, 0, ardopts->size_of_rowset);
stmt->transition_status = STMT_TRANSITION_FETCH_SCROLL;
}
else
#endif
{
mylog("[%s]", func);
ret = PGAPI_Fetch(StatementHandle);
}
ret = DiscardStatementSvp(stmt, ret, FALSE);
LEAVE_STMT_CS(stmt);
return ret;
}
示例3: SQLBindParameter
RETCODE SQL_API
SQLBindParameter(
HSTMT hstmt,
SQLUSMALLINT ipar,
SQLSMALLINT fParamType,
SQLSMALLINT fCType,
SQLSMALLINT fSqlType,
SQLULEN cbColDef,
SQLSMALLINT ibScale,
PTR rgbValue,
SQLLEN cbValueMax,
SQLLEN *pcbValue)
{
RETCODE ret;
StatementClass *stmt = (StatementClass *) hstmt;
mylog("[SQLBindParameter]");
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
StartRollbackState(stmt);
ret = PGAPI_BindParameter(hstmt, ipar, fParamType, fCType,
fSqlType, cbColDef, ibScale, rgbValue, cbValueMax,
pcbValue);
ret = DiscardStatementSvp(stmt, ret, FALSE);
LEAVE_STMT_CS(stmt);
return ret;
}
示例4: SQLExecDirectW
RETCODE SQL_API SQLExecDirectW(HSTMT StatementHandle,
SQLWCHAR *StatementText, SQLINTEGER TextLength)
{
CSTR func = "SQLExecDirectW";
RETCODE ret;
char *stxt;
SQLLEN slen;
StatementClass *stmt = (StatementClass *) StatementHandle;
UWORD flag = 0;
mylog("[%s]", func);
stxt = ucs2_to_utf8(StatementText, TextLength, &slen, FALSE);
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
if (PG_VERSION_GE(SC_get_conn(stmt), 7.4))
flag |= PODBC_WITH_HOLD;
StartRollbackState(stmt);
if (SC_opencheck(stmt, func))
ret = SQL_ERROR;
else
ret = PGAPI_ExecDirect(StatementHandle, stxt, (SQLINTEGER) slen, flag);
ret = DiscardStatementSvp(stmt, ret, FALSE);
LEAVE_STMT_CS(stmt);
if (stxt)
free(stxt);
return ret;
}
示例5: SQLExecute
RETCODE SQL_API
SQLExecute(HSTMT StatementHandle)
{
CSTR func = "SQLExecute";
RETCODE ret;
StatementClass *stmt = (StatementClass *) StatementHandle;
UWORD flag = 0;
mylog("[%s]", func);
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
if (PG_VERSION_GE(SC_get_conn(stmt), 7.4))
flag |= PODBC_WITH_HOLD;
if (SC_opencheck(stmt, func))
ret = SQL_ERROR;
else
{
StartRollbackState(stmt);
stmt->exec_current_row = -1;
ret = PGAPI_Execute(StatementHandle, flag);
ret = DiscardStatementSvp(stmt, ret, FALSE);
}
LEAVE_STMT_CS(stmt);
return ret;
}
示例6: SQLExecDirect
RETCODE SQL_API
SQLExecDirect(HSTMT StatementHandle,
SQLCHAR *StatementText, SQLINTEGER TextLength)
{
CSTR func = "SQLExecDirect";
RETCODE ret;
StatementClass *stmt = (StatementClass *) StatementHandle;
UWORD flag = 0;
mylog("[%s]", func);
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
if (PG_VERSION_GE(SC_get_conn(stmt), 7.4))
flag |= PODBC_WITH_HOLD;
if (SC_opencheck(stmt, func))
ret = SQL_ERROR;
else
{
StartRollbackState(stmt);
ret = PGAPI_ExecDirect(StatementHandle, StatementText, TextLength, flag);
ret = DiscardStatementSvp(stmt, ret, FALSE);
}
LEAVE_STMT_CS(stmt);
return ret;
}
示例7: SQLForeignKeysW
RETCODE SQL_API SQLForeignKeysW(
HSTMT hstmt,
SQLWCHAR *szPkCatalogName,
SQLSMALLINT cbPkCatalogName,
SQLWCHAR *szPkSchemaName,
SQLSMALLINT cbPkSchemaName,
SQLWCHAR *szPkTableName,
SQLSMALLINT cbPkTableName,
SQLWCHAR *szFkCatalogName,
SQLSMALLINT cbFkCatalogName,
SQLWCHAR *szFkSchemaName,
SQLSMALLINT cbFkSchemaName,
SQLWCHAR *szFkTableName,
SQLSMALLINT cbFkTableName)
{
CSTR func = "SQLForeignKeysW";
RETCODE ret;
char *ctName, *scName, *tbName, *fkctName, *fkscName, *fktbName;
SQLLEN nmlen1, nmlen2, nmlen3, nmlen4, nmlen5, nmlen6;
StatementClass *stmt = (StatementClass *) hstmt;
ConnectionClass *conn;
BOOL lower_id;
mylog("[%s]", func);
conn = SC_get_conn(stmt);
lower_id = SC_is_lower_case(stmt, conn);
ctName = ucs2_to_utf8(szPkCatalogName, cbPkCatalogName, &nmlen1, lower_id);
scName = ucs2_to_utf8(szPkSchemaName, cbPkSchemaName, &nmlen2, lower_id);
tbName = ucs2_to_utf8(szPkTableName, cbPkTableName, &nmlen3, lower_id);
fkctName = ucs2_to_utf8(szFkCatalogName, cbFkCatalogName, &nmlen4, lower_id);
fkscName = ucs2_to_utf8(szFkSchemaName, cbFkSchemaName, &nmlen5, lower_id);
fktbName = ucs2_to_utf8(szFkTableName, cbFkTableName, &nmlen6, lower_id);
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
StartRollbackState(stmt);
if (SC_opencheck(stmt, func))
ret = SQL_ERROR;
else
ret = PGAPI_ForeignKeys(hstmt, ctName, (SQLSMALLINT) nmlen1,
scName, (SQLSMALLINT) nmlen2, tbName, (SQLSMALLINT) nmlen3,
fkctName, (SQLSMALLINT) nmlen4, fkscName, (SQLSMALLINT) nmlen5,
fktbName, (SQLSMALLINT) nmlen6);
ret = DiscardStatementSvp(stmt, ret, FALSE);
LEAVE_STMT_CS(stmt);
if (ctName)
free(ctName);
if (scName)
free(scName);
if (tbName)
free(tbName);
if (fkctName)
free(fkctName);
if (fkscName)
free(fkscName);
if (fktbName)
free(fktbName);
return ret;
}
示例8: SC_Constructor
StatementClass *
SC_Constructor(void)
{
StatementClass *rv;
rv = (StatementClass *) malloc(sizeof(StatementClass));
if (rv) {
rv->hdbc = NULL; /* no connection associated yet */
rv->phstmt = NULL;
rv->result = NULL;
rv->manual_result = FALSE;
rv->prepare = FALSE;
rv->status = STMT_ALLOCATED;
rv->internal = FALSE;
SC_clear_error(rv);
rv->statement = NULL;
rv->stmt_with_params[0] = '\0';
rv->statement_type = STMT_TYPE_UNKNOWN;
rv->bindings = NULL;
rv->bindings_allocated = 0;
rv->bookmark.buffer = NULL;
rv->bookmark.used = NULL;
rv->parameters_allocated = 0;
rv->parameters = 0;
rv->currTuple = -1;
rv->rowset_start = -1;
rv->current_col = -1;
rv->bind_row = 0;
rv->last_fetch_count = 0;
rv->save_rowset_size = -1;
rv->data_at_exec = -1;
rv->current_exec_param = -1;
rv->put_data = FALSE;
rv->lobj_fd = -1;
rv->cursor_name[0] = '\0';
/* Parse Stuff */
rv->ti = NULL;
rv->fi = NULL;
rv->ntab = 0;
rv->nfld = 0;
rv->parse_status = STMT_PARSE_NONE;
/* Clear Statement Options -- defaults will be set in AllocStmt */
memset(&rv->options, 0, sizeof(StatementOptions));
}
return rv;
}
示例9: SQLParamData
RETCODE SQL_API
SQLParamData(HSTMT StatementHandle,
PTR *Value)
{
RETCODE ret;
StatementClass *stmt = (StatementClass *) StatementHandle;
mylog("[SQLParamData]");
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
ret = PGAPI_ParamData(StatementHandle, Value);
ret = DiscardStatementSvp(stmt, ret, FALSE);
LEAVE_STMT_CS(stmt);
return ret;
}
示例10: SQLPutData
RETCODE SQL_API
SQLPutData(HSTMT StatementHandle,
PTR Data, SQLLEN StrLen_or_Ind)
{
RETCODE ret;
StatementClass *stmt = (StatementClass *) StatementHandle;
mylog("[SQLPutData]");
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
ret = PGAPI_PutData(StatementHandle, Data, StrLen_or_Ind);
ret = DiscardStatementSvp(stmt, ret, TRUE);
LEAVE_STMT_CS(stmt);
return ret;
}
示例11: SQLMoreResults
RETCODE SQL_API
SQLMoreResults(HSTMT hstmt)
{
RETCODE ret;
StatementClass *stmt = (StatementClass *) hstmt;
mylog("[SQLMoreResults]");
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
StartRollbackState(stmt);
ret = PGAPI_MoreResults(hstmt);
ret = DiscardStatementSvp(stmt, ret, FALSE);
LEAVE_STMT_CS(stmt);
return ret;
}
示例12: SQLCloseCursor
/* New function */
RETCODE SQL_API
SQLCloseCursor(HSTMT StatementHandle)
{
CSTR func = "SQLCloseCursor";
StatementClass *stmt = (StatementClass *) StatementHandle;
RETCODE ret;
mylog("[[%s]]", func);
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
StartRollbackState(stmt);
ret = PGAPI_FreeStmt(StatementHandle, SQL_CLOSE);
ret = DiscardStatementSvp(stmt,ret, FALSE);
LEAVE_STMT_CS(stmt);
return ret;
}
示例13: SQLSetStmtOption
RETCODE SQL_API
SQLSetStmtOption(HSTMT StatementHandle,
SQLUSMALLINT Option, SQLULEN Value)
{
RETCODE ret;
StatementClass *stmt = (StatementClass *) StatementHandle;
mylog("[SQLSetStmtOption]");
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
StartRollbackState(stmt);
ret = PGAPI_SetStmtOption(StatementHandle, Option, Value);
ret = DiscardStatementSvp(stmt, ret, FALSE);
LEAVE_STMT_CS(stmt);
return ret;
}
示例14: SQLNumParams
RETCODE SQL_API
SQLNumParams(HSTMT hstmt,
SQLSMALLINT *pcpar)
{
RETCODE ret;
StatementClass *stmt = (StatementClass *) hstmt;
mylog("[SQLNumParams]");
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
StartRollbackState(stmt);
ret = PGAPI_NumParams(hstmt, pcpar);
ret = DiscardStatementSvp(stmt, ret, FALSE);
LEAVE_STMT_CS(stmt);
return ret;
}
示例15: SQLSetCursorName
RETCODE SQL_API
SQLSetCursorName(HSTMT StatementHandle,
SQLCHAR *CursorName, SQLSMALLINT NameLength)
{
RETCODE ret;
StatementClass *stmt = (StatementClass *) StatementHandle;
mylog("[SQLSetCursorName]");
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
StartRollbackState(stmt);
ret = PGAPI_SetCursorName(StatementHandle, CursorName, NameLength);
ret = DiscardStatementSvp(stmt, ret, FALSE);
LEAVE_STMT_CS(stmt);
return ret;
}