I am adding a column to my database table. It is a simple Char column with either a value of 'Y' or 'N'.
Is it possible to default the column to be 'N'? If so, how?
Current Script to add column:
ALTER TABLE PERSON
ADD IS_ACTIVE VARCHAR2(1);
I am adding a column to my database table. It is a simple Char column with either a value of 'Y' or 'N'.
Is it possible to default the column to be 'N'? If so, how?
Current Script to add column:
ALTER TABLE PERSON
ADD IS_ACTIVE VARCHAR2(1);
On
you just need to add Default <your default value> to it.
for example:
ALTER TABLE person ADD is_active VARCHAR2(20) DEFAULT 'N';
If you want, you can add a NOT NULL constraint: