How to make a field generated

Hi everyone

In my physical DB model, I have a table with a key field. I would like that key to be generated when a row is inserted, but I d’ont know how to do that.

I’ve tried to set the column property “generated” to “insert”, setting the generator as increment, without success.

I’m using Oracle 11.

Thanks!

Hello Yeti,

Do you mean you would like the primary key being inserted automatically when you save the record? In this case you can set the ID Generator of the primary key column to native to achieve this. (see attached pic). Feel free to contact me if you need any help.

Best regards,
Rain
id_generator.png

Hi,

I set generated to “native” on that field, but when I try to do an insert query, I get an error saying ‘cannot insert NULL’ into that field…

Edit : it seems that the oracle sequence is coorectly generated, but in my insert query, I have to fill my key field with the sequence nextVal.

Is there a way to generate a trigger that would fill that field on insert?

Thanks!