[Cialug] DB2

David Stout ragbrai65 at yahoo.com
Wed Sep 21 12:03:47 CDT 2005


Thank to all who replied I have figured it out.
I have to:
 

Create a temp table.

Copy to the temp table from the original tabled, drop original, and

select into new original from the temp table.


David Champion <dave at visionary.com> wrote:
I think Jon was joking.

We might need to start putting tags around stuff today. :p

Back to your original topic: Are you sure that by dropping your ID 
column that you're not going to cause a problem with a relationship / 
constraint / trigger? Relational Databases can be tricky if you don't 
know what you're doing... you could cause a lot of trouble.

-dc

David Stout wrote:
> Where are you located?
> 
> Jon Clemons wrote:Come up here and I can fix that crazy want real quick:)
> 
> ----- Original Message ----- 
> From: "Dave J. Hala Jr." 
> To: "Central Iowa Linux Users Group" 
> Sent: Wednesday, September 21, 2005 9:51 AM
> Subject: Re: [Cialug] DB2
> 
> 
> 
>>Now that makes me want to switch from Mysql to DB2....
>>
>>
>>On Wed, 2005-09-21 at 09:48, Tim Wilson wrote:
>>
>>>It is true, it depends on the version of DB2. In our update scripts,
>>>any time we have to add or delete a column, we go through these steps:
>>>1. ALTER TABLE table DROP CONSTRAINT constraint; (Do this for each 
>>>constraint).
>>>2. RENAME TABLE table TO oldtable;
>>>3. CREATE TABLE table ...
>>>4. INSERT INTO table ... SELECT ... FROM oldtable;
>>>5. DROP TABLE oldtable;
>>>
>>>On 9/21/05, David Stout wrote:
>>>
>>>>There is no Primary or Foreign Key on this column.
>>>>I have the same privileges as admin
>>>>
>>>>Dave Weis wrote:
>>>>
>>>>Try
>>>>ALTER TABLE payroll DROP company_id
>>>>If it's a key as the name implies it might have constraints from other
>>>>tables preventing it from being dropped at all.
>>>>
>>>>On Wed, 21 Sep 2005, David Stout wrote:
>>>>
>>>>
>>>>>I tryed this
>>>>>
>>>>>ALTER TABLE PAYROLL
>>>>>DROP COLUMN COMPANY_ID
>>>>>
>>>>>and got this
>>>>>
>>>>>
>>>>>Error: SQL0104N An unexpected token "COLUMN" was found following 
>>>>>"TABLE
>>>>
>>>>PAYROLL DROP". Expected tokens may include: "CONSTRAINT". 
>>>>SQLSTATE=42601
>>>>
>>>>>(State:42601, Native Code: FFFFFF98)
>>>>>
>>>>>
>>>>>"Nathan C. Smith" wrote:
>>>>>'Alter table' in SQL?
>>>>>
>>>>>-----Original Message-----
>>>>>From: David Stout [mailto:ragbrai65 at yahoo.com]
>>>>>Sent: Wednesday, September 21, 2005 8:59 AM
>>>>>To: cialug at cialug.org
>>>>>Subject: [Cialug] DB2
>>>>>
>>>>>
>>>>
>>>>! > I need a little help does anyone know If you can delete a column 
>>>>from a
>>>>table in DB2. If so what is the syntax?
>>>>
>>>>>
>>>>>David Stout
>>>>>BTS Billing Team
>>>>>Data Repository & Reports
>>>>>
>>>>>---------------------------------
>>>>>Yahoo! for Good
>>>>>Click here to donate to the Hurricane Katrina relief effort.
>>>>
>>>>_______________________________________________
>>>>
>>>>>Cialug mailing list
>>>>>Cialug at cialug.org
>>>>>http://cialug.org/mailman/listinfo/cialug
>>>>>
>>>>>
>>>>>David Stout
>>>>>BTS Billing Team
>>>>>Data Repository & Reports
>>>>>
>>>>>---------------------------------
>>>>>Yahoo! for Good
>>>>>Click here to donate to the Hurricane Katrina relief effort.
>>>>
>>>>--
>>>>Dave Weis
>>>>djweis at internetsolver.com
>>>>http://www.internetsolver.com/
>>>>
>>>>_______________________________________________
>>>>Cialug mailing list
>>>>Cialug at cialug.org
>>>>http://cialug.org/mailman/listinfo/cialug
>>>>
>>>>
>>>>David Stout
>>>>BTS Billing Team
>>>>Data Repository & Reports
>>>>
>>>>________________________________
>>>>Yahoo! for Good
>>>>Click here to donate to the Hurricane Katrina relief effort.
>>>>
>>>>
>>>>_______________________________________________
>>>>Cialug mailing list
>>>>Cialug at cialug.org
>>>>http://cialug.org/mailman/listinfo/cialug
>>>>
>>>>
>>>>
>>>
>>>
>>>--
>>>Tim
>>>_______________________________________________
>>>Cialug mailing list
>>>Cialug at cialug.org
>>>http://cialug.org/mailman/listinfo/cialug
>>
>>-- 
>>
>>Open Source Information Systems, Inc. (OSIS)
>>Dave J. Hala Jr., President 
>>641.485.1606
>>
>>_______________________________________________
>>Cialug mailing list
>>Cialug at cialug.org
>>http://cialug.org/mailman/listinfo/cialug
>>
> 
> 
> 
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
> 
> 
> 
> David Stout
> BTS Billing Team
> Data Repository & Reports
> 
> ---------------------------------
> Yahoo! for Good
> Click here to donate to the Hurricane Katrina relief effort. 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug


_______________________________________________
Cialug mailing list
Cialug at cialug.org
http://cialug.org/mailman/listinfo/cialug



David Stout
BTS Billing Team
Data Repository & Reports
__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cialug.org/pipermail/cialug/attachments/20050921/b8b5f821/attachment.html


More information about the Cialug mailing list