當前位置: 首頁>>代碼示例>>C++>>正文


C++ ClearStatement函數代碼示例

本文整理匯總了C++中ClearStatement函數的典型用法代碼示例。如果您正苦於以下問題:C++ ClearStatement函數的具體用法?C++ ClearStatement怎麽用?C++ ClearStatement使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ClearStatement函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: ClearStatement

OGRErr OGRSQLiteSelectLayer::ResetStatement()

{
    int rc;

    ClearStatement();

    iNextShapeId = 0;
    bDoStep = TRUE;

#ifdef DEBUG
    CPLDebug( "OGR_SQLITE", "prepare(%s)", poBehaviour->osSQLCurrent.c_str() );
#endif

    rc = sqlite3_prepare( poDS->GetDB(), poBehaviour->osSQLCurrent,
                          static_cast<int>(poBehaviour->osSQLCurrent.size()),
                          &hStmt, NULL );

    if( rc == SQLITE_OK )
    {
        return OGRERR_NONE;
    }
    else
    {
        CPLError( CE_Failure, CPLE_AppDefined,
                  "In ResetStatement(): sqlite3_prepare(%s):\n  %s",
                  poBehaviour->osSQLCurrent.c_str(), sqlite3_errmsg(poDS->GetDB()) );
        hStmt = NULL;
        return OGRERR_FAILURE;
    }
}
開發者ID:Wedjaa,項目名稱:node-gdal,代碼行數:31,代碼來源:ogrsqliteselectlayer.cpp

示例2: ClearStatement

OGRErr OGRSQLiteTableLayer::ResetStatement()

{
    int rc;
    CPLString osSQL;

    ClearStatement();

    iNextShapeId = 0;

    osSQL.Printf( "SELECT _rowid_, * FROM '%s' %s",
                    pszEscapedTableName, 
                    osWHERE.c_str() );

    rc = sqlite3_prepare( poDS->GetDB(), osSQL, osSQL.size(),
		          &hStmt, NULL );

    if( rc == SQLITE_OK )
    {
	return OGRERR_NONE;
    }
    else
    {
        CPLError( CE_Failure, CPLE_AppDefined, 
                  "In ResetStatement(): sqlite3_prepare(%s):\n  %s", 
                  osSQL.c_str(), sqlite3_errmsg(poDS->GetDB()) );
        hStmt = NULL;
        return OGRERR_FAILURE;
    }
}
開發者ID:AsherBond,項目名稱:MondocosmOS,代碼行數:30,代碼來源:ogrsqlitetablelayer.cpp

示例3: ClearStatement

OGRFeature *OGRWalkTableLayer::GetFeature( long nFeatureId )

{
    if( pszFIDColumn == NULL )
        return OGRWalkLayer::GetFeature( nFeatureId );

    ClearStatement();

    iNextShapeId = nFeatureId;

    poStmt = new CPLODBCStatement( poDS->GetSession() );
    poStmt->Append( "SELECT * FROM " );
    poStmt->Append( poFeatureDefn->GetName() );
    poStmt->Append( "Features" );
    poStmt->Appendf( " WHERE %s = %ld", pszFIDColumn, nFeatureId );

    if( !poStmt->ExecuteSQL() )
    {
        delete poStmt;
        poStmt = NULL;
        return NULL;
    }

    return GetNextRawFeature();
}
開發者ID:samalone,項目名稱:gdal-ios,代碼行數:25,代碼來源:ogrwalktablelayer.cpp

示例4: ClearStatement

OGRSQLiteViewLayer::~OGRSQLiteViewLayer()

{
    ClearStatement();
    CPLFree(pszEscapedTableName);
    CPLFree(pszEscapedUnderlyingTableName);
}
開發者ID:agrismart,項目名稱:gdal-1.9.2,代碼行數:7,代碼來源:ogrsqliteviewlayer.cpp

示例5: ClearStatement

void OGRDB2SelectLayer::ResetReading()

{
    if( iNextShapeId != 0 )
        ClearStatement();

    OGRDB2Layer::ResetReading();
}
開發者ID:Wedjaa,項目名稱:node-gdal,代碼行數:8,代碼來源:ogrdb2selectlayer.cpp

示例6: ClearStatement

void OGRGeomediaSelectLayer::ResetReading()

{
    if( iNextShapeId != 0 )
        ClearStatement();

    OGRGeomediaLayer::ResetReading();
}
開發者ID:OSGeo,項目名稱:gdal,代碼行數:8,代碼來源:ogrgeomediaselectlayer.cpp

示例7: ClearStatement

void OGRMSSQLSpatialSelectLayer::ResetReading()

{
    if( iNextShapeId != 0 )
        ClearStatement();

    OGRMSSQLSpatialLayer::ResetReading();
}
開發者ID:koordinates,項目名稱:gdal,代碼行數:8,代碼來源:ogrmssqlspatialselectlayer.cpp

示例8: CPLFree

OGRODBCTableLayer::~OGRODBCTableLayer()

{
    CPLFree( pszTableName );
    CPLFree( pszSchemaName );

    CPLFree( pszQuery );
    ClearStatement();
}
開發者ID:469447793,項目名稱:World-Wind-Java,代碼行數:9,代碼來源:ogrodbctablelayer.cpp

示例9: CPLFree

OGRMSSQLSpatialTableLayer::~OGRMSSQLSpatialTableLayer()

{
    CPLFree( pszTableName );
    CPLFree( pszSchemaName );

    CPLFree( pszQuery );
    ClearStatement();
}
開發者ID:sylvainallard,項目名稱:gdal,代碼行數:9,代碼來源:ogrmssqlspatialtablelayer.cpp

示例10: ResetStatement

OGRFeature *OGRGeoPackageLayer::GetNextFeature()

{
    for( ; TRUE; )
    {
        OGRFeature      *poFeature;

        if( m_poQueryStatement == NULL )
        {
            ResetStatement();
            if (m_poQueryStatement == NULL)
                return NULL;
        }

    /* -------------------------------------------------------------------- */
    /*      Fetch a record (unless otherwise instructed)                    */
    /* -------------------------------------------------------------------- */
        if( bDoStep )
        {
            int rc;

            rc = sqlite3_step( m_poQueryStatement );
            if( rc != SQLITE_ROW )
            {
                if ( rc != SQLITE_DONE )
                {
                    sqlite3_reset(m_poQueryStatement);
                    CPLError( CE_Failure, CPLE_AppDefined,
                            "In GetNextRawFeature(): sqlite3_step() : %s",
                            sqlite3_errmsg(m_poDS->GetDB()) );
                }

                ClearStatement();

                return NULL;
            }
        }
        else
            bDoStep = TRUE;

        poFeature = TranslateFeature(m_poQueryStatement);
        if( poFeature == NULL )
            return NULL;

        if( (m_poFilterGeom == NULL
            || FilterGeometry( poFeature->GetGeomFieldRef(m_iGeomFieldFilter) ) )
            && (m_poAttrQuery == NULL
                || m_poAttrQuery->Evaluate( poFeature )) )
            return poFeature;

        delete poFeature;
    }
}
開發者ID:drownedout,項目名稱:datamap,代碼行數:53,代碼來源:ogrgeopackagelayer.cpp

示例11: EQUAL

OGRErr OGRGeomediaTableLayer::SetAttributeFilter( const char *pszQueryIn )

{
    if( (pszQueryIn == NULL && this->pszQuery == NULL)
        || (pszQueryIn != NULL && this->pszQuery != NULL
            && EQUAL(pszQueryIn,this->pszQuery)) )
        return OGRERR_NONE;

    CPLFree( this->pszQuery );
    this->pszQuery = pszQueryIn ? CPLStrdup( pszQueryIn ) : NULL;

    ClearStatement();

    return OGRERR_NONE;
}
開發者ID:Wedjaa,項目名稱:node-gdal,代碼行數:15,代碼來源:ogrgeomediatablelayer.cpp

示例12: EQUAL

OGRErr OGRMSSQLSpatialTableLayer::SetAttributeFilter( const char *pszQuery )

{
    if( (pszQuery == NULL && this->pszQuery == NULL)
        || (pszQuery != NULL && this->pszQuery != NULL 
            && EQUAL(pszQuery,this->pszQuery)) )
        return OGRERR_NONE;

    CPLFree( this->pszQuery );
    this->pszQuery = (pszQuery) ? CPLStrdup( pszQuery ) : NULL;

    ClearStatement();

    return OGRERR_NONE;
}
開發者ID:sylvainallard,項目名稱:gdal,代碼行數:15,代碼來源:ogrmssqlspatialtablelayer.cpp

示例13: CPLFree

OGRErr OGRPGeoTableLayer::SetAttributeFilter( const char *pszQuery )

{
    CPLFree(m_pszAttrQueryString);
    m_pszAttrQueryString = (pszQuery) ? CPLStrdup(pszQuery) : NULL;

    if( (pszQuery == NULL && this->pszQuery == NULL)
        || (pszQuery != NULL && this->pszQuery != NULL 
            && EQUAL(pszQuery,this->pszQuery)) )
        return OGRERR_NONE;

    CPLFree( this->pszQuery );
    this->pszQuery = pszQuery ? CPLStrdup( pszQuery ) : NULL; 

    ClearStatement();

    return OGRERR_NONE;
}
開發者ID:rashadkm,項目名稱:lib_gdal,代碼行數:18,代碼來源:ogrpgeotablelayer.cpp

示例14: CPLFree

OGRErr OGRODBCTableLayer::SetAttributeFilter( const char *pszQueryIn )

{
    CPLFree(m_pszAttrQueryString);
    m_pszAttrQueryString = (pszQueryIn) ? CPLStrdup(pszQueryIn) : NULL;

    if( (pszQueryIn == NULL && pszQuery == NULL)
        || (pszQueryIn != NULL && pszQuery != NULL
            && EQUAL(pszQueryIn, pszQuery)) )
        return OGRERR_NONE;

    CPLFree( pszQuery );
    pszQuery = pszQueryIn != NULL ? CPLStrdup( pszQueryIn ) : NULL;

    ClearStatement();

    return OGRERR_NONE;
}
開發者ID:ryandavid,項目名稱:rotobox,代碼行數:18,代碼來源:ogrodbctablelayer.cpp

示例15: GetLayerDefn

OGRErr OGRMSSQLSpatialTableLayer::DeleteFeature( long nFID )

{
    GetLayerDefn();
    
    if( pszFIDColumn == NULL )
    {
        CPLError( CE_Failure, CPLE_AppDefined, 
                  "DeleteFeature() without any FID column." );
        return OGRERR_FAILURE;
    }
    
    if( nFID == OGRNullFID )
    {
        CPLError( CE_Failure, CPLE_AppDefined, 
                  "DeleteFeature() with unset FID fails." );
        return OGRERR_FAILURE;
    }
    
    ClearStatement();

/* -------------------------------------------------------------------- */
/*      Drop the record with this FID.                                  */
/* -------------------------------------------------------------------- */
    CPLODBCStatement oStatement( poDS->GetSession() );

    oStatement.Appendf("DELETE FROM [%s] WHERE [%s] = %ld", 
            poFeatureDefn->GetName(), pszFIDColumn, nFID);
    
    if( !oStatement.ExecuteSQL() )
    {
        CPLError( CE_Failure, CPLE_AppDefined, 
                  "Attempt to delete feature with FID %ld failed. %s", 
                  nFID, poDS->GetSession()->GetLastError() );

        return OGRERR_FAILURE;
    }
    
    return OGRERR_NONE;
}
開發者ID:sylvainallard,項目名稱:gdal,代碼行數:40,代碼來源:ogrmssqlspatialtablelayer.cpp


注:本文中的ClearStatement函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。