当前位置: 首页>>代码示例>>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;未经允许,请勿转载。