Start a new topic

Export tables issues

[This topic is migrated from our old forums. The original author name has been removed]

We are busy migrating from Sybase to Db2. As we don't have the sql scripts in source control I need to export the schema from an existing database(Sybase). I am seeing a few issues with what is generated. When I view the DDL table in dbvis I am shown: CREATE TABLE agent_interaction_assoc ( agent_id INT, interaction_id INT, is_src BIT DEFAULT 1, CONSTRAINT agent_inte_6546223442 PRIMARY KEY (agent_id, interaction_id) ); But when exporting I the following is generated: CREATE TABLE agent_interaction_assoc (agent_id INT NOT NULL, interaction_id INT NOT NULL, is_src SMALLINT DEFAULT 1, CONSTRAINT agent_inte_20800074102 PRIMARY KEY (id)); There is no column name: *id* which causes an error when creating the schema. It seems to do this for tables that use a compound PRIMARY KEY * Note I manually changed BIT to SMALLINT dbvis: 9.1.13 Sybase driver: JTDS 1.2 OS: linux mint 17.1 JRE: 1.7.0_76

[This reply is migrated from our old forums.]

Re: Export tables issues
Hi Philip, I'm unable to reproduce this problem with test tables where one has a two-column compound PK and the other has a two-column FK pointing to the first, using DbVisualizer 9.1.13. Looking at the code, I see that we have made a some changes since 9.1.13 that may be able to explain this if there are tables with the same name in other databases, so it would be great if you can try this out with the latest version, 9.2.13. If your license is not valid for that version, you can install it in a separate folder and then use Help->Evaluate Pro to enable the Pro features for a few weeks. You can download DbVisualizer 9.2.13 here: http://www.dbvis.com/download/ You also say that it looks correct in the DDL tab but not when you export the table. Can you please clarify, because the Export Schema and Export Table features use the same code to generate the DDL as is used for the DDL tab. How do you export the table? Are you using one of the Export actions or the @export command, or something else? Either way, please open Tools->Debug Window and enable debugging for DbVisualizer. Then perform this operation again and include the debug output in your reply. Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: Export tables issues
Hi Hans, My apologies for wasting your time. My script was modified and tables with compound keys had 'id' added. mea culpa *face palm*
[This reply is migrated from our old forums.]

Re: Export tables issues
Hi Philip, No problem, I'm glad you figured it out. Best Regards, Hans