loopback icon indicating copy to clipboard operation
loopback copied to clipboard

Oracle db not generating auto id , if i give my column id:true

Open lokeshjain20 opened this issue 9 years ago • 4 comments

Oracle db not generating auto id if i give a column with name id(or any other name),type : string and id : true If I don't give any column with id:true , then it by default creates id column with type number and auto generates the id , but if i make any column as id:true with type change to string it do not generate id , and gives "Cannot insert null into table.column id"

lokeshjain20 avatar Jun 09 '17 07:06 lokeshjain20

@lokeshjain20 When you got the error message Cannot insert null into table.column id, did you not only define your own id (primary key) but also assign some value to the id when you create a model?

Setogit avatar Jun 14 '17 15:06 Setogit

while creating the model , i do not assign any value to id column , as i expect oracle to generate it , but if id column is number it only then autogenerates the id

lokeshjain20 avatar Jun 19 '17 06:06 lokeshjain20

@lokeshjain20 If you define the column with id : true, you will need to explicitly assign some value to the column.

If you do not define any columns with id : true, the connector will define a primary key with the name idfor you. In creating a model in such a case, an auto-generated value will be used.

Setogit avatar Jun 19 '17 20:06 Setogit

Please submit a new issue if needed. closing one month or older issues. thanks!

Setogit avatar Jul 21 '17 20:07 Setogit