By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,236 Members | 1,453 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,236 IT Pros & Developers. It's quick & easy.

drop 'Not Null' constraint

P: n/a
Is there any command (alter table ...?) to drop 'Not Null' constraint
on a column? I have a column CODE which has 'Not Null' constraint
defined and I want to drop 'Not Null'. Please let me know.

Droping the table and recreating would be my last option...

Thanks

Oct 10 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
I'm afraid that--outside of perhaps using the ALTOBJ stored
procedure--you'll have to drop the table.

http://groups.google.com/group/comp....302969f3dea192

--Jeff

an*************@gmail.com wrote:
Is there any command (alter table ...?) to drop 'Not Null' constraint
on a column? I have a column CODE which has 'Not Null' constraint
defined and I want to drop 'Not Null'. Please let me know.

Droping the table and recreating would be my last option...

Thanks
Oct 10 '06 #2

P: n/a
an*************@gmail.com wrote:
Is there any command (alter table ...?) to drop 'Not Null' constraint
on a column? I have a column CODE which has 'Not Null' constraint
defined and I want to drop 'Not Null'. Please let me know.

Droping the table and recreating would be my last option...
After upgrading to DB2 9? Good, do that.
Then run ALTER TABLE ALTER COLUMN
followed by a REORG.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Oct 10 '06 #3

P: n/a
It's DB2 V8.2. Not sure when the upgrade to V9...

any short cut in V8.2 for droping Not Null constraint?

THanks

Serge Rielau wrote:
an*************@gmail.com wrote:
Is there any command (alter table ...?) to drop 'Not Null' constraint
on a column? I have a column CODE which has 'Not Null' constraint
defined and I want to drop 'Not Null'. Please let me know.

Droping the table and recreating would be my last option...
After upgrading to DB2 9? Good, do that.
Then run ALTER TABLE ALTER COLUMN
followed by a REORG.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Oct 10 '06 #4

P: n/a
an*************@gmail.com wrote:
It's DB2 V8.2. Not sure when the upgrade to V9...

any short cut in V8.2 for droping Not Null constraint?
That makes ALTOBJ() your second last option I suppose. ;-)
No shortcut.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Oct 11 '06 #5

P: n/a
an*************@gmail.com wrote:
Is there any command (alter table ...?) to drop 'Not Null' constraint
on a column? I have a column CODE which has 'Not Null' constraint
defined and I want to drop 'Not Null'. Please let me know.

Droping the table and recreating would be my last option...

Thanks
That depends how it was ADDed.

If the NOT NULL CONSTRAINT was ADDed manually, a standard ALTER TABLE
<table nameDROP CONSTRAINT <constraint name>; should do the trick. If
it was added automagically, others have responded.

Just another reason to do things manually.

B.

Oct 16 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.