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, impossible to add feature with an identity field #33681

Closed
SebastienPeillet opened this issue Jan 9, 2020 · 0 comments · Fixed by #33683
Closed

Oracle, impossible to add feature with an identity field #33681

SebastienPeillet opened this issue Jan 9, 2020 · 0 comments · Fixed by #33683
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@SebastienPeillet
Copy link
Contributor

Describe the bug
In Oracle, there is a type of field that generated values as serial type in postgresql. This type is called identity and values are generated by default or always.

It's not possible to add feature with digitize maptool nor table attribute when the identity field is always generated because oracle does not allow a insert request where a value (even the default value with the sequential) is given for this field.

oracle_always_identity

For example in the image above, a table with a pk field (identity generated always) will not allow :

INSERT INTO test( "pk", "cnt", "name", "name2", "num_char", "geom" ) VALUES ( ?, ?, ?, ?, ?, ? )

the request should be :

INSERT INTO test("cnt", "name", "name2", "num_char", "geom") VALUES ( ?, ?, ?, ?, ? )

without the pk field.

Futhermore, default value like "ISEQ$$_75967".nextval (sequential for identity field) is not interpreted with the digitize maptool for both mode :

oracle_always_identity2

when the identity value is generated by default and not always, it is possible to customize the value to do it work.

How to Reproduce

  1. create a table with a identity field :
    CREATE TABLE QGIS.POINT_DATA_IDENTITY ( "pk" NUMBER GENERATED ALWAYS AS IDENTITY PRIMARY KEY, GEOM SDO_GEOMETRY);
  2. add the layer to your qgis project
  3. Try to add a new feature with digitize maptool or attribute table
  4. It's not possible to commit the result

QGIS and OS versions

QGIS version 3.10.1-A Coruña QGIS code revision 1d221185e1
Compiled against Qt 5.12.2 Running against Qt 5.12.2
Compiled against GDAL/OGR 2.4.0 Running against GDAL/OGR 2.4.0
Compiled against GEOS 3.7.1-CAPI-1.11.1 Running against GEOS 3.7.1-CAPI-1.11.1 27a5e771
Compiled against SQLite 3.27.2 Running against SQLite 3.27.2
PostgreSQL Client Version 11.5 (Ubuntu 11.5-0ubuntu0.19.04.1) SpatiaLite Version 4.3.0a
QWT Version 6.1.4 QScintilla2 Version 2.10.4
Compiled against PROJ 5.2.0 Running against PROJ Rel. 5.2.0, September 15th, 2018
OS Version Ubuntu 19.04 This copy of QGIS writes debugging output.
Active python plugins thyrsis

Additional context

@SebastienPeillet SebastienPeillet added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jan 9, 2020
SebastienPeillet pushed a commit to SebastienPeillet/QGIS that referenced this issue Jan 9, 2020
SebastienPeillet pushed a commit to SebastienPeillet/QGIS that referenced this issue Feb 4, 2020
SebastienPeillet pushed a commit to SebastienPeillet/QGIS that referenced this issue May 22, 2020
nyalldawson pushed a commit to nyalldawson/QGIS that referenced this issue Jun 2, 2020
nyalldawson pushed a commit that referenced this issue Jun 19, 2020
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!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant