db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Dudziak" <tom...@gmail.com>
Subject Re: How to alter tables.
Date Thu, 26 Jul 2007 04:38:17 GMT
On 7/24/07, callme_sanjay <callme_sanjay@yahoo.com> wrote:

> Question is like I have two tables "table_A" & "table_B" and I want to move
> the specific column from "table_A" to "table_B"
>
> How I should make these changes to get such things done.

You simply specify the table as they should be, e.g. the column in
table B but not in A, and you set alterDatabase to true in the
writeSchemaToDatabase subtask.

However, please note that this will drop the data in the column in
table A. If there is a correspondence between rows in table A and
table B, and you want to move the data as well, you need to export the
data first to XML. Then use e.g. a XSL stylesheet to change the data
file so that the column with the data is in table B in the resulting
XML. And then after altering you reimport that data.

Tom

Mime
View raw message