Oracle SQL developer: Set column to auto increment

1152090 pts.
Tags:
Oracle SQL
SQL development
Would there be a way for me to set my column to increment automatically using Oracle SQL Developer? Or is this just not possible? I've done with MySQL before but not this way.
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • carlosdl
    Yes, you can, although that is done via SQL, not as a feature of SQL Developer.

    How to do it would depend on the database version you are using (which was not specified).

    On 12c, you can do it as easily as declaring the column this way:

    your_column NUMBER GENERATED ALWAYS AS IDENTITY


    On previous versions, you would need to create a sequence manually, and if you want it to be automatic, you will also need a trigger.
    85,390 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: