From ddlutils-user-return-567-apmail-db-ddlutils-user-archive=db.apache.org@db.apache.org Fri Jan 12 16:21:20 2007 Return-Path: Delivered-To: apmail-db-ddlutils-user-archive@www.apache.org Received: (qmail 9308 invoked from network); 12 Jan 2007 16:21:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Jan 2007 16:21:20 -0000 Received: (qmail 7820 invoked by uid 500); 12 Jan 2007 16:21:27 -0000 Delivered-To: apmail-db-ddlutils-user-archive@db.apache.org Received: (qmail 7717 invoked by uid 500); 12 Jan 2007 16:21:26 -0000 Mailing-List: contact ddlutils-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ddlutils-user@db.apache.org Delivered-To: mailing list ddlutils-user@db.apache.org Received: (qmail 7706 invoked by uid 99); 12 Jan 2007 16:21:26 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jan 2007 08:21:26 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [194.198.209.10] (HELO dns2.intron.net) (194.198.209.10) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jan 2007 08:21:15 -0800 Received: from [192.168.97.35] (twitter.intron.net [82.115.149.1]) by dns2.intron.net (8.12.10/8.12.10/2.4a) with ESMTP id l0CGKp4a004777 for ; Fri, 12 Jan 2007 17:20:51 +0100 Message-ID: <45A7B559.9030906@imcode.com> Date: Fri, 12 Jan 2007 17:20:41 +0100 From: =?ISO-8859-1?Q?Christoffer_Hammarstr=F6m?= User-Agent: Icedove 1.5.0.8 (X11/20061116) MIME-Version: 1.0 To: ddlutils-user@db.apache.org Subject: Renaming columns X-Enigmail-Version: 0.94.1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig266049E087029FDD423E147A" X-Virus-Checked: Checked by ClamAV on apache.org --------------enig266049E087029FDD423E147A Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi! I'm trying to rename and change the type of some columns in MSSQL and MySQL databases. I have tables "templates", "text_docs", and "templates_cref". "templates" has primary key "template_id", which is referred by foreign keys "text_docs.template_id" and "templates_cref.template_id". What i want to do is to drop the "templates" table, and then rename the "template_id" column in "text_docs" and "templates_cref" to "template_name". Also, i want to change the "template_id" column and a couple of other columns from an integer column to a varchar(80) column, and taking their new values from the "simple_name" column corresponding to the "template_id" in the dropped "templates" table. I've found no easy way to accomplish this using the ddlutils API. I can't call column.setName(newColumnName), because that makes ddlutils think that the old column has been removed and a new column has been adde= d. Perhaps someone could point me to the best way to do this? Thanks! --=20 Christoffer Hammarstr=F6m Programmerare, imCMS, http://www.imcode.com/ kreiger@imcode.com --------------enig266049E087029FDD423E147A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFp7VeMzTw53AfVYMRAsrcAJ0U84Xuffqz3vu+Oe4KAiNPlcROlQCeMPkB nzKeCv4BmAAv4016SN33Yhc= =Dooc -----END PGP SIGNATURE----- --------------enig266049E087029FDD423E147A--