How to set a conditional DEFAULT value to a column? [message #375098] |
Wed, 25 July 2001 21:49 |
Priya Rajkumar
Messages: 5 Registered: March 2001
|
Junior Member |
|
|
How to set a conditional DEFAULT value to a column?
Hi all,
I am trying to set a DEFAULT value to a column based on a condition.
For Example,
I have a table TEST with col1 VARCHAR2(10) and col2 VARCHAR2(10) as its columns. I would like to DEFAULT a value let's say 'X' to col2 based on the value in col1. If SUBSTR(col1, 1, 2) = '12' then DEFAULT the col2 to 'X' else NULL.
Is this possible? I am using Oracle 8.0.6 on Unix.
Priya
|
|
|
|
|