Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 63631 invoked from network); 19 Feb 2008 18:26:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Feb 2008 18:26:04 -0000 Received: (qmail 87258 invoked by uid 500); 19 Feb 2008 18:25:57 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 87229 invoked by uid 500); 19 Feb 2008 18:25:57 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 87218 invoked by uid 99); 19 Feb 2008 18:25:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2008 10:25:57 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [63.82.107.6] (HELO red.amberpoint.com) (63.82.107.6) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2008 18:25:12 +0000 Received: from [127.0.0.1] (bpendleton-desk.edgility.com [10.10.12.203]) by red.amberpoint.com (8.14.0/8.12.11) with ESMTP id m1JIPUmj026175 for ; Tue, 19 Feb 2008 10:25:30 -0800 (PST) Message-ID: <47BB1F1A.9020705@amberpoint.com> Date: Tue, 19 Feb 2008 10:25:30 -0800 From: Bryan Pendleton User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Derby Discussion Subject: Re: moving columns between tables References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org > Is there a way to easily move a column from one table to another (as > easy as a rename say)? alter table newtable add column newcolumn whatever-data-type; update newtable set newcolumn = (value that the newcolumn should have); alter table oldtable drop column oldcolumn; You'll also have to do some work to drop any constraints on the old column from the old table, then add those constraints to the new column in the new table once it's populated. thanks, bryan