Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to update a tabular form of a table with Primary Key set as Identity Always?

DannyS-OracleAug 30 2016 — edited Aug 31 2016

Hi guys, I am struggling with this specific problem for hours. Hopefully someone can help me on this.

As the question described above, I have a tabular form which is built from a table, which has a primary key ('ID') set as "Identity Always". This became a problem for the tabular form, because whenever I made changes to the data and click on 'Save', Apex will display this error: ORA-32796: cannot update a generated always identity column

I tried several workaround such as ROWID, but this solution would not work because I need to join the tabular form with fields from other tables to display additional info - hence the ROWID would not be preserved and could not be used as primary key.

I also read in an Apex documentation that:

Utilizing the IDENTITY clause on a table *can* have an impact on Application Express applications. An error will be raised by the database if an IDENTITY column, with ALWAYS parameter specified, is included in an INSERT or UPDATE statement. The Application Express Builder has been enhanced to allow the specification of the identity clause within the Create Table Wizard. The Create Form wizard will generate a "Display Only" item for an identity column with the ALWAYS parameter.

Which I do not understand. Apex indeed generated an extra column ('ID_Display'), but it does not change the fact that my tabular form still throw the same error (ORA-32796 above). How is this "Display Only" item can save me from the "cannot update a generated always identity column"?

As a side note, I am developing in apex.oraclecorp.com, Apex as a service, where I cannot access the files or made SQL alteration to my table. Please let me know if you encountered this problem before and found a solution - thanks in advance!

P.S. the Apex version is 5.0.4.

EDIT:

I just noticed there is the SQL Command UI to perform SQL operation. Sorry, please bear with my little experience with Apex.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 28 2016
Added on Aug 30 2016
2 comments
753 views