Re: HOW DO I CREATE A TABLE SCHEMA from an existing Table. I want the SQL.
Briane,
Download DbVisualizer 5.1 (just released). It supports generating CREATE TABLE
statements for Oracle, DB2, SQL Server, Informix, Mimer, PostgreSQL, MySQL, Sybase ASE and JavaDB/Derby.
Regards
Roger
a
anonymous
said
about 18 years ago
[This reply is migrated from our old forums. The original author name has been removed]
Re: HOW DO I CREATE A TABLE SCHEMA from an existing Table. I want the SQL.
I don't think that that response addresses the question.
As I understand it, the question is "If I have an existing table, how do I generate the SQL statement that will create a duplicate table with the same schema?". Version 5.1 does support CREATE TABLE for Informix but does not seem to support generating the actual SQL statement to create a duplicate table.
I must admit that I haven't tried using the Create Table Wizard to create a duplicate and then previewing the SQL. That would probably work but would be (IMO) a bad solution to the problem.
Roger Bjärevall
said
about 18 years ago
[This reply is migrated from our old forums.]
Re: HOW DO I CREATE A TABLE SCHEMA from an existing Table. I want the SQL.
Hi,
Generate CREATE TABLE DDL in 5.1 generates the DDL to re-create the table. It does however not generate the SQL INSERTS to fill the data into the table. Use Export/Import to achive that.
Is this answer appropriate?
Regards
Roger
a
anonymous
said
about 18 years ago
[This reply is migrated from our old forums. The original author name has been removed]
Re: HOW DO I CREATE A TABLE SCHEMA from an existing Table. I want the SQL.
When I right click on the table I want to copy and then select Script Object to SQL Editor and then Create Table I get the following:
"com.onseven.dbvis.Z.G.C:ORDER BY column (colno) must be in SELECT list."
These are the specs I'm running:
Product: DbVisualizer Personal 5.1
Build: #1160 (2006/10/05 17:47)
Java VM: Java HotSpot(TM) Client VM
Java Version: 1.5.0_06-b05
Java Vendor: Sun Microsystems Inc.
OS Name: Windows XP
OS Arch: x86
OS Version: 5.1
and I'm working with an Informix database.
btw - You're second response was appropriate - thanks for the quick reply :)
Roger Bjärevall
said
about 18 years ago
[This reply is migrated from our old forums.]
Re: HOW DO I CREATE A TABLE SCHEMA from an existing Table. I want the SQL.
Hi,
Hmm... what version of Informix are you using? Can you please email the script so that we can re-create the table locally?
Regards
Roger
a
anonymous
said
about 18 years ago
[This reply is migrated from our old forums. The original author name has been removed]
Re: HOW DO I CREATE A TABLE SCHEMA from an existing Table. I want the SQL.
The Informix version is 7.31
Unfortunately I cannot provide you with any of the table information...
a
anonymous
said
about 18 years ago
[This reply is migrated from our old forums. The original author name has been removed]
Re: HOW DO I CREATE A TABLE SCHEMA from an existing Table. I want the SQL.
Sorry for all the fuss but this seems to be fixed in version 5.1.1 :)
Roger Bjärevall
said
about 18 years ago
[This reply is migrated from our old forums.]
Re: HOW DO I CREATE A TABLE SCHEMA from an existing Table. I want the SQL.
Hi,
I assume you mean that the error sitatuation happening with Informix no longer occur?
Regards
Roger
a
anonymous
said
about 16 years ago
[This reply is migrated from our old forums. The original author name has been removed]
Re: HOW DO I CREATE A TABLE SCHEMA from an existing Table. I want the SQL.
You can use the SQL:
CREATE table yourschema.yourtable2 AS (SELECT * FROM yourschema.yourtable1);
If you want to create table with no data then
CREATE table yourschema.yourtable2 as (SELECT * FROM yourschema.yourtable1 WHERE 1=2);
If you want to create table with only selected columns then you can mentioned those column names in your SELECT statement.
anonymous