Liquibase Community Forum
2010-12-09 16:39:16 UTC
A new topic, 'LB2.0-RC7: <renameTable> causes DB2-Error', has been made on a board you are watching.
You can see it at
http://liquibase.org/forum/index.php?topic=824.new#new
The text of the topic is shown below:
Hi all,
we faced a problem when trying to update a DB2 (v9.7) database with a <renameTable> tag in the update script. We ran LB (v2.0-RC7) via Ant in a build target like
<updateDatabase
changeLogFile="${liquibase.changelog.create.meta}"
driver="${jdbc.db.driver}"
classpathref="classpath"
url="${jdbc.db.url}"
username="${jdbc.db.user}"
password="${jdbc.db.pwd}"
defaultSchemaName="${jdbc.db.schema}"
promptOnNonLocalDatabase="${liquibase.prompt.non.local.db}"
contexts="${liquibase.customer}"
<changeLogProperty name="liquibase.schema" value="${jdbc.db.schema}" />
</updateDatabase>
and a <renameTable> tag in the update script like this
<renameTable schemaName="${liquibase.schema}"
oldTableName="old_table_name"
newTableName="new_table_name"
/>
The LB generated SQL for the DB2 was
RENAME db_schema.old_table_name TO db_schema.new_table_name
which caused a DB2 error with sqlcode: -108. The correct DB2 SQL should have been
RENAME db_schema.old_table_name TO new_table_name
Running the same script with a Ant target nearly the same as before, but leaving out the defaultSchemaName attribute for the <updateDatabase> task works for the DB2. Unfortunately we need this defaultSchemaName attribute as we have to run the same scripts against a MS SQL database for which this attribute fixes a the [dbo] issue (topic "MSSQL2005: Controll tables allways in [dbo]-schema (using 2.0-RC7)").
Is there anyone with an idea?
-Thanks in davance!!
Frank
Unsubscribe to new topics from this board by clicking here: http://liquibase.org/forum/index.php?action=notifyboard;board=1.0
Regards,
The Liquibase Community Forum Team.
You can see it at
http://liquibase.org/forum/index.php?topic=824.new#new
The text of the topic is shown below:
Hi all,
we faced a problem when trying to update a DB2 (v9.7) database with a <renameTable> tag in the update script. We ran LB (v2.0-RC7) via Ant in a build target like
<updateDatabase
changeLogFile="${liquibase.changelog.create.meta}"
driver="${jdbc.db.driver}"
classpathref="classpath"
url="${jdbc.db.url}"
username="${jdbc.db.user}"
password="${jdbc.db.pwd}"
defaultSchemaName="${jdbc.db.schema}"
promptOnNonLocalDatabase="${liquibase.prompt.non.local.db}"
contexts="${liquibase.customer}"
<changeLogProperty name="liquibase.schema" value="${jdbc.db.schema}" />
</updateDatabase>
and a <renameTable> tag in the update script like this
<renameTable schemaName="${liquibase.schema}"
oldTableName="old_table_name"
newTableName="new_table_name"
/>
The LB generated SQL for the DB2 was
RENAME db_schema.old_table_name TO db_schema.new_table_name
which caused a DB2 error with sqlcode: -108. The correct DB2 SQL should have been
RENAME db_schema.old_table_name TO new_table_name
Running the same script with a Ant target nearly the same as before, but leaving out the defaultSchemaName attribute for the <updateDatabase> task works for the DB2. Unfortunately we need this defaultSchemaName attribute as we have to run the same scripts against a MS SQL database for which this attribute fixes a the [dbo] issue (topic "MSSQL2005: Controll tables allways in [dbo]-schema (using 2.0-RC7)").
Is there anyone with an idea?
-Thanks in davance!!
Frank
Unsubscribe to new topics from this board by clicking here: http://liquibase.org/forum/index.php?action=notifyboard;board=1.0
Regards,
The Liquibase Community Forum Team.