Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oracle provider is not able to handle non-geometric tables correctly #20060

Closed
qgib opened this issue Dec 11, 2014 · 1 comment
Closed

Oracle provider is not able to handle non-geometric tables correctly #20060

qgib opened this issue Dec 11, 2014 · 1 comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Dec 11, 2014

Author Name: Médéric RIBREUX (Médéric RIBREUX)
Original Redmine Issue: 11843
Affected QGIS version: 2.6.0
Redmine category:data_provider/oracle
Assignee: Jürgen Fischer


Hello,

it seems that the Oracle provider of QGis is not able to handle non-geometric tables correctly.

Under Python API, I've found that you need to use a QgsFeatureRequest with a flag set to NoGeometry to be able to fetch features.
This is not the default behavior as written in PyQGis cookbook and nor PostGIS or Spatialite ones.

The following code returns no feature on an Oracle non-geographic layer (even with a primary key). Under PostGIS and Spatialite, the code succeeds.

layer = QgsMapLayerRegistry.instance().mapLayersByName('MY_ATTRIBUTE_TABLE')[0]
for f in layer.getFeatures():
  print f

You have to restrict to a NoGeometry QgsFeatureRequest if you want to fetch features:

layer = QgsMapLayerRegistry.instance().mapLayersByName('MY_ATTRIBUTE_TABLE')[0]
for f in layer.getFeatures(QgsFeatureRequest().setFlags(QgsFeatureRequest.NoGeometry)):
  print f

Furthermore, this bug seems to have a bad impact on the "Select by Expression" dialog: it is impossible to make a selection with this dialog on a non-geographic Oracle table. Whatever you type in the expression builder, the selection is always empty. I suspect that this problem is linked to the above one.

Steps to reproduce:

  • Open a a non geographic table under Qgis and select it.
  • Open the Select by Expression dialog on the loaded layer.
  • Try to build a query selection expression like:

or

  • Clic on select button
  • The selection is still empty

Best regards,

@qgib
Copy link
Contributor Author

qgib commented Dec 11, 2014

Author Name: Jürgen Fischer (@jef-n)


Fixed in changeset "e5e85a5445b469de99b7bfc7c70fe2534ce76482".


  • status_id was changed from Open to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers labels May 25, 2019
@qgib qgib added this to the Version 2.8 milestone May 25, 2019
@qgib qgib closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers
Projects
None yet
Development

No branches or pull requests

1 participant