0

Before this I already asked about on how to add a new column and set it as a unique. oracle 11g - add new column and set as unique

It does not have any problem to set a unique to the new column if the table is EMPTY. But I am facing a problem to set a unique to the new column if the table have a data [NOT EMPTY]

Can I set a unique to the new column that I added if the table is NOT EMPTY?

Community
  • 1
  • 1
Fai Zal Dong
  • 323
  • 6
  • 25
  • What is your error? Unique accepts mulitple NULLs - so it supposed to work fine – dcieslak Mar 17 '16 at 04:46
  • @dcieslak Actually it did not return any error. It successfully adding new column but not set the new column to unique. – Fai Zal Dong Mar 17 '16 at 06:39
  • Add your statement that you use to question. – dcieslak Mar 17 '16 at 06:42
  • Add your *statements*, plural; as the question you linked to said, you need separate `alter table` commands. Show both statements, the result you got from them, and if you ran both show why you think it didn't work - how are you checking for uniqueness? – Alex Poole Mar 17 '16 at 08:50

0 Answers0