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 Philip Mark Donaghy <ph...@gmail.com> on 2006/01/20 16:05:03 UTC

How do I obtain the ddl to dreate the database.

I am trying to obtain a file that has the create table statements.

I use ddlToDatabase in the following way,

    <createDatabase/>
    <writeSchemaToDatabase/>
    <writeSchemaSqlToFile outputFile="database.ddl"/>

I expected the create table statements to be in database.ddl but it
contains only the table alter statements.

ALTER TABLE "book"
    ADD CONSTRAINT "book_FK_author_id_author" FOREIGN KEY
("author_id") REFERENCES "author" ("author_id");

ALTER TABLE "book"
    DROP CONSTRAINT "book_FK_author_id_author";

Am I missing something?

--
Philip Donaghy
donaghy.blogspot.com del.icio.us/donaghy/philip
Skype: philipmarkdonaghy
Office: +33 5 56 60 88 02
Mobile: +33 6 20 83 22 62

Re: How do I obtain the ddl to dreate the database.

Posted by Philip Mark Donaghy <ph...@gmail.com>.
Thanks, that works.

On 1/20/06, Martin van den Bemt <ml...@mvdb.net> wrote:
> Just from a quick look at the code (I never used the tasks before) :
> alterDatbase should be set to false to get the full ddl in the file. doDrops should be set to true
> or false depending on your needs.
> Afaik it will not do anything to your database.
>
> Mvgr,
> Martin
>
> Philip Mark Donaghy wrote:
> > I am trying to obtain a file that has the create table statements.
> >
> > I use ddlToDatabase in the following way,
> >
> >     <createDatabase/>
> >     <writeSchemaToDatabase/>
> >     <writeSchemaSqlToFile outputFile="database.ddl"/>
> >
> > I expected the create table statements to be in database.ddl but it
> > contains only the table alter statements.
> >
> > ALTER TABLE "book"
> >     ADD CONSTRAINT "book_FK_author_id_author" FOREIGN KEY
> > ("author_id") REFERENCES "author" ("author_id");
> >
> > ALTER TABLE "book"
> >     DROP CONSTRAINT "book_FK_author_id_author";
> >
> > Am I missing something?
> >
> > --
> > Philip Donaghy
> > donaghy.blogspot.com del.icio.us/donaghy/philip
> > Skype: philipmarkdonaghy
> > Office: +33 5 56 60 88 02
> > Mobile: +33 6 20 83 22 62
> >
> >
>


--
Philip Donaghy
donaghy.blogspot.com del.icio.us/donaghy/philip
Skype: philipmarkdonaghy
Office: +33 5 56 60 88 02
Mobile: +33 6 20 83 22 62

Re: How do I obtain the ddl to dreate the database.

Posted by Martin van den Bemt <ml...@mvdb.net>.
Just from a quick look at the code (I never used the tasks before) :
alterDatbase should be set to false to get the full ddl in the file. doDrops should be set to true 
or false depending on your needs.
Afaik it will not do anything to your database.

Mvgr,
Martin

Philip Mark Donaghy wrote:
> I am trying to obtain a file that has the create table statements.
> 
> I use ddlToDatabase in the following way,
> 
>     <createDatabase/>
>     <writeSchemaToDatabase/>
>     <writeSchemaSqlToFile outputFile="database.ddl"/>
> 
> I expected the create table statements to be in database.ddl but it
> contains only the table alter statements.
> 
> ALTER TABLE "book"
>     ADD CONSTRAINT "book_FK_author_id_author" FOREIGN KEY
> ("author_id") REFERENCES "author" ("author_id");
> 
> ALTER TABLE "book"
>     DROP CONSTRAINT "book_FK_author_id_author";
> 
> Am I missing something?
> 
> --
> Philip Donaghy
> donaghy.blogspot.com del.icio.us/donaghy/philip
> Skype: philipmarkdonaghy
> Office: +33 5 56 60 88 02
> Mobile: +33 6 20 83 22 62
> 
>