Alter Table <tablename> Alter Column <columnname> Set Default 'abc' not working
I tried to execute the below given SQL statement and was confronted with the following error in DB2 7.2
1 .The table is test_emp in SQLP72 database.
2. The column for which default is being set is emp_name, having data type varchar(50) Not Null
SQL-statement:
ALTER table SQLP72.test_emp ALTER column emp_name SET default 'xyz';
-----------------------------------------------------------------------------
ERROR:
DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned:
SQL0104N An unexpected token "default 'xyz'" was found following "column emp_name SET". Expected tokens may include: "<space>". SQLSTATE=42601
I checked the syntax in DB2 reference manuals, andit seems correct. One interesting thing is that I'm able to alter the columns data type, but not the default value.
Pls help me out at the earliest....
Thanks in advance,
Kos