diff --git a/src/providers/oracle/qgsoracleprovider.cpp b/src/providers/oracle/qgsoracleprovider.cpp index 27252fc15d..63727639f7 100644 --- a/src/providers/oracle/qgsoracleprovider.cpp +++ b/src/providers/oracle/qgsoracleprovider.cpp @@ -1239,11 +1239,6 @@ bool QgsOracleProvider::addFeatures( QgsFeatureList &flist, QgsFeatureSink::Flag fieldId << idx; defaultValues << defaultValue( idx ).toString(); } - - if ( !getfid.prepare( QStringLiteral( "SELECT %1 FROM %2 WHERE ROWID=?" ).arg( keys ).arg( mQuery ) ) ) - { - throw OracleException( tr( "Could not prepare get feature id statement" ), getfid ); - } } QgsAttributes attributevec = flist[0].attributes(); @@ -1328,31 +1323,6 @@ bool QgsOracleProvider::addFeatures( QgsFeatureList &flist, QgsFeatureSink::Flag if ( !ins.exec() ) throw OracleException( tr( "Could not insert feature %1" ).arg( features->id() ), ins ); - if ( !( flags & QgsFeatureSink::FastInsert ) ) - { - if ( mPrimaryKeyType == PktRowId ) - { - features->setId( mShared->lookupFid( QList() << QVariant( ins.lastInsertId() ) ) ); - QgsDebugMsgLevel( QStringLiteral( "new fid=%1" ).arg( features->id() ), 4 ); - } - else if ( mPrimaryKeyType == PktInt || mPrimaryKeyType == PktFidMap ) - { - getfid.addBindValue( QVariant( ins.lastInsertId() ) ); - if ( !getfid.exec() || !getfid.next() ) - throw OracleException( tr( "Could not retrieve feature id %1" ).arg( features->id() ), getfid ); - - int col = 0; - Q_FOREACH ( int idx, mPrimaryKeyAttrs ) - { - QgsField fld = field( idx ); - - QVariant v = getfid.value( col++ ); - if ( v.type() != fld.type() ) - v = QgsVectorDataProvider::convertValue( fld.type(), v.toString() ); - features->setAttribute( idx, v ); - } - } - } } ins.finish();