You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
D, [2020-09-14T19:17:12.205496 #52369] DEBUG -- : next sequence value (113.6ms) SELECT "T_TEXT_FILE_SEQ".NEXTVAL FROM dual
It tries guess sequence name T_TEXT_FILE_SEQ and use it.
If I uncomment self.sequence_name = :autogenerated, the error is:
ArgumentError: Trigger based primary key is not supported
Obviously I am not trying to use trigger. I just want to disable using sequence and rely on a new mechanism of using Identity available from Oracle 12. I see the change comes from #1669, :autogenerated can not be used anymore since 6.x. But how am I supped to use as identity columns? self.sequence_name = :autogenerated will not work too and will lead to null pointer error.
The text was updated successfully, but these errors were encountered:
gavvvr
changed the title
How to create records into table with 'generated always as identity' primary key?
How to create records into table with generated 'as identity' primary key?
Sep 14, 2020
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
As of right now, Oracle enhanced adapter does not support identity data type then it should not work. There was a plan to support it but did not have enough time/motivation to implement it.
Steps to reproduce
So I have Oracle v12 which means I can use
as identity
in column definition to get autogenerated id. I have the following table:My model is:
The code I execute is:
Expected behavior
Database insert without errors
Actual behavior
I get the following error:
What is going on in logs at the same time:
It tries guess sequence name
T_TEXT_FILE_SEQ
and use it.If I uncomment
self.sequence_name = :autogenerated
, the error is:Obviously I am not trying to use trigger. I just want to disable using sequence and rely on a new mechanism of using Identity available from Oracle 12. I see the change comes from #1669,
:autogenerated
can not be used anymore since 6.x. But how am I supped to useas identity
columns?self.sequence_name = :autogenerated
will not work too and will lead to null pointer error.System configuration
I use ActiveRecord without Rails:
Oracle enhanced adapter version:
Ruby version:
2.6.6
Oracle Database version:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0
The text was updated successfully, but these errors were encountered: