472,952 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,952 software developers and data experts.

drop 'Not Null' constraint

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
5 8761
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Marion Jakob | last post by:
hi i'm using mssql server 2000 i want to remove a not null column constraint from the column answertext in table answertext. i tried the following line ALTER TABLE AnswerText ALTER COLUMN...
2
by: James Knowlton | last post by:
Hello, I'm just returning to MS SQL Server after two years of dealing with Sybase ASE. I need to drop a column, using the alter table command. I keep getting an error indicating that a...
2
by: T.S.Negi | last post by:
Hi there, I have created a hash table. After using it, somehow the primary key constraint of this hash table still exist in database. Which cause error. When I delete this constraint with...
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not...
10
by: hilz | last post by:
Hi all. I have a table that i create in MsAccess, using ado connection as follows: create table PAYITEM ( PAYITEM_ID COUNTER PRIMARY KEY, PAYITEM_NAME ...
1
by: Thomas Chille | last post by:
Hello! I have a Problem. A table with a ForeignKeyRef exits. The Name of the field with this FK-Constraint is 'id_employee' because it is referencing the field 'id_employee' in...
3
by: dgirdhar | last post by:
Hello, I created one table say "Table1" with one column say "Column1" with constraint Not Null. Oracle generated its own name for this constraint. Say SYS_C#########. I want to delete this...
0
by: okonita | last post by:
DB2v8.2 LUW. Unable to drop Foreign Key constraints...although DROP constraints returns undefined name. Am I missing somrthing here? Hi all, I have a perplexing DB2 Drop command situation....
1
by: KingofGing | last post by:
Hi All, I'm having a problem writing an SQL statement that I can't quite wrap my head around. First, the background: I have a journal subscription system including 3 tables, tblSubscription,...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.