You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-user@db.apache.org by callme_sanjay <ca...@yahoo.com> on 2007/07/24 13:55:32 UTC

How to alter tables.

Hello Team, 
I am new to Ddlutils , 

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.

Please reply 

Regards
-Sanjay 
-- 
View this message in context: http://www.nabble.com/How-to-alter-tables.-tf4135471.html#a11761482
Sent from the Apache DdlUtils - User mailing list archive at Nabble.com.


Re: How to alter tables.

Posted by Thomas Dudziak <to...@gmail.com>.
On 7/24/07, callme_sanjay <ca...@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