One Star

Generate an auto increment primary key in Oracle

I want to create a primary key auto increment under oracle!
I had created an output table (Oracle)  and  I want to add an automatic primary key! how can I do that ?


 
6 REPLIES
Fifteen Stars

Re: Generate an auto increment primary key in Oracle

One Star

Re: Generate an auto increment primary key in Oracle

 Thanks for your reply but it doesn't work ! I get this error 
ORA-00957: duplicate column name
Fifteen Stars

Re: Generate an auto increment primary key in Oracle

You are adding an extra ID column. Your schema already includes it and you are adding a new one with your advanced settings. Change the "Before" to "Replace" in the advanced settings.
Rilhia Solutions
One Star

Re: Generate an auto increment primary key in Oracle

Even when I change the "Before" to "Replace", I still get the same error :/  
Seventeen Stars

Re: Generate an auto increment primary key in Oracle

Simply set the ID column in the schema as inactive or better remove it.
Fifteen Stars

Re: Generate an auto increment primary key in Oracle

You need to change "Colonne de ref" to "ID" if you haven't. You are essentially replacing the value that would have been placed in this column with the next value of the sequence. 
EDIT: ....or do what Jlolling said. Either will work
Rilhia Solutions