<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>ddlutils-user@db.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/"/>
<id>http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/</id>
<updated>2009-12-07T07:26:26Z</updated>
<entry>
<title>Re: Why DDLUtils keeps create temporary tables even when operation is allowed in Driver</title>
<author><name>Chris Hyzer &lt;mchyzer@yahoo.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200911.mbox/%3c346990.66770.qm@web51103.mail.re2.yahoo.com%3e"/>
<id>urn:uuid:%3c346990-66770-qm@web51103-mail-re2-yahoo-com%3e</id>
<updated>2009-11-18T20:22:03Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I have a situation where I am using the ddlutils API for postgres, and I add a bunch of columns
in a table (nullable, no default value), and it creates a temporary table.  I look in ddlutils
and the source code is completely different from the latest stable jar... when is the next
version being released so I can see if the issue exists in the latest code?

Thanks,
Chris



________________________________
From: Rasha &lt;rasha.abdallah@murex.com&gt;
To: ddlutils-user@db.apache.org
Sent: Thu, October 29, 2009 11:38:03 AM
Subject: Why DDLUtils keeps create temporary tables even when operation is allowed in Driver


Hi, 

I was searching the mailing list for an explanation on why DDLUtils attempt
to resolve most operations by creating a temporary table, migrating data to
it, dropping and recreating original column. 
According to the post in
http://www.nabble.com/Plataform.getAlterTablesSql-results-ts4864470.html#a4864470 
This should happen only if the implementation does not support the requested
operation. 

In my case, I am using a Derby database, and I am attempting to do a
ColumnRequiredChange 

Original Table:
&lt;table name="author"&gt;
    &lt;column name="author_id" type="INTEGER" primaryKey="true" required="true"
/&gt;
    &lt;column name="author_name" type="VARCHAR" size="50" required="true" /&gt;
    &lt;column name="organisation" type="VARCHAR" size="50" required="true" /&gt;
&lt;/table&gt;


Desired Model 

&lt;table name="author"&gt;
    &lt;column name="author_id" type="INTEGER" primaryKey="true" required="true"
/&gt;
    &lt;column name="author_name" type="VARCHAR" size="50" required="true" /&gt;
    &lt;column name="organisation" type="VARCHAR" size="50" required="false" /&gt;
&lt;/table&gt;

I do not understand why in this case, the table is being dropped and
recreated. 
Although derby supports doing 

alter table author
alter organisation null


Thanks for your help 
Rasha

-- 
View this message in context: http://www.nabble.com/Why-DDLUtils-keeps-create-temporary-tables-even-when-operation-is-allowed-in-Driver-tp26116530p26116530.html
Sent from the Apache DdlUtils - User mailing list archive at Nabble.com.


      

</pre>
</div>
</content>
</entry>
<entry>
<title>Why DDLUtils keeps create temporary tables even when operation is allowed in Driver</title>
<author><name>Rasha &lt;rasha.abdallah@murex.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200910.mbox/%3c26116530.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c26116530-post@talk-nabble-com%3e</id>
<updated>2009-10-29T16:38:03Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hi, 

I was searching the mailing list for an explanation on why DDLUtils attempt
to resolve most operations by creating a temporary table, migrating data to
it, dropping and recreating original column. 
According to the post in
http://www.nabble.com/Plataform.getAlterTablesSql-results-ts4864470.html#a4864470 
This should happen only if the implementation does not support the requested
operation. 

In my case, I am using a Derby database, and I am attempting to do a
ColumnRequiredChange 

Original Table:
&lt;table name="author"&gt;
	&lt;column name="author_id" type="INTEGER" primaryKey="true" required="true"
/&gt;
	&lt;column name="author_name" type="VARCHAR" size="50" required="true" /&gt;
	&lt;column name="organisation" type="VARCHAR" size="50" required="true" /&gt;
&lt;/table&gt;


Desired Model 

&lt;table name="author"&gt;
	&lt;column name="author_id" type="INTEGER" primaryKey="true" required="true"
/&gt;
	&lt;column name="author_name" type="VARCHAR" size="50" required="true" /&gt;
	&lt;column name="organisation" type="VARCHAR" size="50" required="false" /&gt;
&lt;/table&gt;

I do not understand why in this case, the table is being dropped and
recreated. 
Although derby supports doing 

alter table author
alter organisation null


Thanks for your help 
Rasha

-- 
View this message in context: http://www.nabble.com/Why-DDLUtils-keeps-create-temporary-tables-even-when-operation-is-allowed-in-Driver-tp26116530p26116530.html
Sent from the Apache DdlUtils - User mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: DB export stops when XML file is 63 MB</title>
<author><name>Thomas Dudziak &lt;tomdzk@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200910.mbox/%3c224f32340910051833tba174ffl63c24c3f8e8a1c00@mail.gmail.com%3e"/>
<id>urn:uuid:%3c224f32340910051833tba174ffl63c24c3f8e8a1c00@mail-gmail-com%3e</id>
<updated>2009-10-06T01:33:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

there should be no limits other than what the file system allows
(which should be way above 63MB). You could try bumping up the log
verbosity (via the verbosity parameter if you're using the Ant tasks)
to see if you get more details on what the problem is.

Tom

On Wed, Sep 30, 2009 at 04:28, Thylex &lt;thylex@gmail.com&gt; wrote:
&gt; Hi all,
&gt;
&gt; I'm trying to use ddlutils to move a database from MySQL to Derby. The
&gt; schema XML file gets written just fine and looks OK, but it seems that the
&gt; export stops when the data-XML reaches around 63 MB in size. It stops in the
&gt; middle of a record without finishing that record. A check with wc shows the
&gt; XML file to have 636268 lines in it and 65.334.602 characters.
&gt; Since it stops in the middle of a record I get the feel that it runs into
&gt; some form of size limit, so...
&gt;
&gt; Are there limits to the size of the XML export files?
&gt;
&gt; I've tried with DdlUtils-1.0.jar from the download section, and I also tried
&gt; building one from the SVN trunk with the same result.
&gt;
&gt;
&gt; Best regards
&gt;
&gt; Henrik Svensson
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>DB export stops when XML file is 63 MB</title>
<author><name>Thylex &lt;thylex@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200909.mbox/%3ca5d774eb0909300428m77dd8a7et211c791f1deb203c@mail.gmail.com%3e"/>
<id>urn:uuid:%3ca5d774eb0909300428m77dd8a7et211c791f1deb203c@mail-gmail-com%3e</id>
<updated>2009-09-30T11:28:54Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi all,

I'm trying to use ddlutils to move a database from MySQL to Derby. The
schema XML file gets written just fine and looks OK, but it seems that the
export stops when the data-XML reaches around 63 MB in size. It stops in the
middle of a record without finishing that record. A check with wc shows the
XML file to have 636268 lines in it and 65.334.602 characters.
Since it stops in the middle of a record I get the feel that it runs into
some form of size limit, so...

Are there limits to the size of the XML export files?

I've tried with DdlUtils-1.0.jar from the download section, and I also tried
building one from the SVN trunk with the same result.


Best regards

Henrik Svensson


</pre>
</div>
</content>
</entry>
<entry>
<title>writeschemasqltofile creates blank file</title>
<author><name>gla-001 &lt;gla-001@isys-software.de&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200909.mbox/%3c25330367.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c25330367-post@talk-nabble-com%3e</id>
<updated>2009-09-07T13:18:07Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hi everybody,

similar to other posts
(http://www.nabble.com/problem-writing-sql-to-file-td3876914.html#a3876914,
http://www.nabble.com/No-output-from-writeSchemaSqlTofile-command-td17453074.html#a17516352),
&lt;writeschemasqltofile&gt; creates a blank file. As recommended i set
alterdatabase="false" without any effect. I tried to convert the generated
xml to sql using &lt;ddlToDatabase&gt;, without success. My Ant-Target looks like
this:

	&lt;target name="database-dump" description="Create dump"&gt;

	  &lt;mkdir dir="${out.dir}" /&gt;
		
	  &lt;taskdef name="databaseToDdl"
classname="org.apache.ddlutils.task.DatabaseToDdlTask" /&gt;
		
	  &lt;databaseToDdl modelname="MyModel" verbosity="debug"
databasetype="oracle9" 
	  	usedelimitedsqlidentifiers="true" tabletypes="TABLE"
schemapattern="MySchema"&gt;
	  	
	    &lt;database url="jdbc:oracle:thin:@[host]:1521:orcl"
	            driverClassName="oracle.jdbc.OracleDriver"
	            username="[usr]"
	            password="[pwd]"
	    		initialsize="5"
	    		testonborrow="true"
	    		testonreturn="true"/&gt;
	  	
	  	&lt;writeschemasqltofile failonerror="false"
outputfile="${out.dir}/schema.sql"/&gt;
	    &lt;writeSchemaToFile failonerror="false"
outputFile="${out.dir}/schema.xml"/&gt;
	  &lt;/databaseToDdl&gt;

	&lt;/target&gt;

The XML file is created properly.

Does anybody have an idea?

Thanks in advance!

Cheers,

GLA


-- 
View this message in context: http://www.nabble.com/writeschemasqltofile-creates-blank-file-tp25330367p25330367.html
Sent from the Apache DdlUtils - User mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Renaming a column in the target database.</title>
<author><name>Jan van Bulck &lt;jan.vanbulck@caracara.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200907.mbox/%3c3be791060907300927v6495e05fx11566dd49653c27d@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3be791060907300927v6495e05fx11566dd49653c27d@mail-gmail-com%3e</id>
<updated>2009-07-30T16:27:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Dear all,

I would like to move a database schema (and data) from MySQL to Derby.
Things work very well but there remains one little challenge.

I would like to rename the column the target-database.

Calling
   targetPlatform.alterModel()
after inserting the data,  recreates the table, loosing the data.

A simple
   model.findTable( "table1" ).findColumn( "col1" ).setName( "colXXX" );
does not help neither:
      - or the sourceModel can't fetch from the source database anymore
      - or the targetModel doesn't match the datafile anymore

Does anybody know about an API feature I didn't find yet?

Thank you!
J.


</pre>
</div>
</content>
</entry>
<entry>
<title>Error while executing SQL CREATE UNIQUE INDEX PRIMARY ON</title>
<author><name>flow1986 &lt;fsalbe@gmx.at&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200907.mbox/%3c24607554.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c24607554-post@talk-nabble-com%3e</id>
<updated>2009-07-22T14:29:12Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hi!

I'm using ddlutils (1.0) and mysql (5.0.67)

I'm using this ant buildfile:

&lt;?xml version="1.0"?&gt;
&lt;project name="" basedir="."&gt;
  &lt;path id="classpath"&gt;
    &lt;fileset dir="./lib"&gt;
      &lt;include name="**/*.jar" /&gt;
    &lt;/fileset&gt;
  &lt;/path&gt;
  &lt;target name="export-source-db"
  description="Dumps db structure and data"&gt;
    &lt;taskdef name="databaseToDdl"
    classname="org.apache.ddlutils.task.DatabaseToDdlTask"&gt;
      &lt;classpath refid="classpath" /&gt;
    &lt;/taskdef&gt;
    &lt;databaseToDdl modelName="MigrateTest" databasetype="mysql5" &gt;
      &lt;database url="jdbc:mysql://localhost/forexport"
      driverClassName="com.mysql.jdbc.Driver" username="root"
      password="" /&gt;
      &lt;writeSchemaToFile outputFile="db-schema.xml" /&gt;
      &lt;writeDataToFile outputFile="data.xml" /&gt;
    &lt;/databaseToDdl&gt;
  &lt;/target&gt;
  &lt;target name="import-target-db"
  description="Creates db and loads data" &gt;
    &lt;taskdef name="ddlToDatabase"
    classname="org.apache.ddlutils.task.DdlToDatabaseTask"&gt;
      &lt;classpath refid="classpath" /&gt;
    &lt;/taskdef&gt;
    &lt;ddlToDatabase schemaFile="db-schema.xml" databasetype="mysql5"
verbosity="debug"&gt;
      &lt;database url="jdbc:mysql://localhost/dbstufftest"
      driverClassName="com.mysql.jdbc.Driver"
      username="root" password="" /&gt;
     &lt;!-- &lt;createDatabase failonerror="false" /&gt; --&gt;
      &lt;writeSchemaToDatabase /&gt;
      &lt;writeDataToDatabase datafile="data.xml" /&gt;
    &lt;/ddlToDatabase&gt;
  &lt;/target&gt;
&lt;/project&gt;


When i try to execute import-target-db after if exported the data I get the
following error:

[ddlToDatabase] SQL Command CREATE UNIQUE INDEX PRIMARY ON campaign_users
(campaign_id, user_id) failed with: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL serv
er version for the right syntax to use near 'PRIMARY ON campaign_users
(campaign_id, user_id)' at line 1

Do you have any ideas?
-- 
View this message in context: http://www.nabble.com/Error-while-executing-SQL-CREATE-UNIQUE-INDEX-PRIMARY-ON-tp24607554p24607554.html
Sent from the Apache DdlUtils - User mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>migration leads to ORACLE data block corrupted</title>
<author><name>SSL &lt;stefan.schmitz-linneweber@synlogic.ch&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200905.mbox/%3c23761958.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c23761958-post@talk-nabble-com%3e</id>
<updated>2009-05-28T13:42:51Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Dear all,

i face a strange problem.
We try to migrate/update a schema using ddlutils with oracle 10.1.0.2 (on
windows)
During migration we get  ORA-01578: ORACLE data block corrupted
Further examination showed that an primary key index of a newly created
table (ipd_lre_)
was corrupted. This tables has been created by ddlutils and the data from
ipd_lre
was being copied incompletely to this table.
ipd_lre contained about 50000 lines at the beginning.
After recreating the corrupted index  and starting the migration again (4
times).
It finish, but all rows were eliminated.

We could not identify any disk or i/o problems.

We created a new tablespace/datafile and imported the schema.
The problem was reproduced, again the corruption error ocured.

ipd_lre has a primary key using to columns
ipd_lre has also clob data columns

We use an oracle 11 thin jdbc driver.

Of course there are lots of different ways to try?
But what do you think is the most promising?
Anyone who had similar problems?

Thanks
Stefan Schmitz-Linneweber

-- 
View this message in context: http://www.nabble.com/migration-leads-to-ORACLE-data-block-corrupted-tp23761958p23761958.html
Sent from the Apache DdlUtils - User mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Views, stored procedures, triggers, packages, synonyms and privileges</title>
<author><name>&quot;Mark Price&quot; &lt;mprice@airversent.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200905.mbox/%3cFE0E2BA8E292614CB0088E2C4E5BFADD0199EC83@owm-mail1.airversent.com%3e"/>
<id>urn:uuid:%3cFE0E2BA8E292614CB0088E2C4E5BFADD0199EC83@owm-mail1-airversent-com%3e</id>
<updated>2009-05-04T19:23:49Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I am trying to find out if DdlUtils contains support for views, stored
procedures, triggers, packages, synonyms and privileges.

 

Mark

 



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: xml data file format?</title>
<author><name>Rusty Wright &lt;rusty.wright@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200903.mbox/%3c49CB01B3.7060808@gmail.com%3e"/>
<id>urn:uuid:%3c49CB01B3-7060808@gmail-com%3e</id>
<updated>2009-03-26T04:16:51Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Done; DDLUTILS-242 and DDLUTILS-243.

Thomas Dudziak wrote:
&gt; On Tue, Mar 24, 2009 at 9:50 PM, Rusty Wright &lt;rusty.wright@gmail.com&gt; wrote:
&gt;&gt; Thanks; I didn't see that.
&gt;&gt;
&gt;&gt; 1) I still think it would be nice if the format could be documented on the
&gt;&gt; ddlutils web site, obviously in a non-specific way but also with a specific
&gt;&gt; simple example.  It seems to me that it's very similar to DbUnit's
&gt;&gt; non-verbose format so you could use their explanation as a starting point.
&gt; 
&gt; Sure. Could you file a JIRA ticket for that ?
&gt; 
&gt;&gt; 2) The documentation for writeDtdToFile says "This sub task does not require
&gt;&gt; a database connection, so the dataSource sub element of the enclosing task
&gt;&gt; can be omitted." which is incorrect, it does require a connection, and, to
&gt;&gt; split hairs over terminology, it should say "database sub element" instead
&gt;&gt; "dataSource sub element" since the xml tag it's referring to is &lt;database&gt;
&gt;&gt; and not &lt;dataSource&gt;.
&gt; 
&gt; The writeDtdToFile sub task is also available in the ddlToDatabase
&gt; task and I think that task doesn't require a DB connection.
&gt; 
&gt; Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: xml data file format?</title>
<author><name>Thomas Dudziak &lt;tomdzk@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200903.mbox/%3c224f32340903242223i6c38ae4u1eed3204ce8e27cd@mail.gmail.com%3e"/>
<id>urn:uuid:%3c224f32340903242223i6c38ae4u1eed3204ce8e27cd@mail-gmail-com%3e</id>
<updated>2009-03-25T05:23:13Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Tue, Mar 24, 2009 at 9:50 PM, Rusty Wright &lt;rusty.wright@gmail.com&gt; wrote:
&gt; Thanks; I didn't see that.
&gt;
&gt; 1) I still think it would be nice if the format could be documented on the
&gt; ddlutils web site, obviously in a non-specific way but also with a specific
&gt; simple example. Â It seems to me that it's very similar to DbUnit's
&gt; non-verbose format so you could use their explanation as a starting point.

Sure. Could you file a JIRA ticket for that ?

&gt; 2) The documentation for writeDtdToFile says "This sub task does not require
&gt; a database connection, so the dataSource sub element of the enclosing task
&gt; can be omitted." which is incorrect, it does require a connection, and, to
&gt; split hairs over terminology, it should say "database sub element" instead
&gt; "dataSource sub element" since the xml tag it's referring to is &lt;database&gt;
&gt; and not &lt;dataSource&gt;.

The writeDtdToFile sub task is also available in the ddlToDatabase
task and I think that task doesn't require a DB connection.

Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: xml data file format?</title>
<author><name>Rusty Wright &lt;rusty.wright@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200903.mbox/%3c49C9BAB8.5030802@gmail.com%3e"/>
<id>urn:uuid:%3c49C9BAB8-5030802@gmail-com%3e</id>
<updated>2009-03-25T05:01:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
The dbUnit format I'm thinking of is their FlatXmlDataSet;

  http://dbunit.sourceforge.net/components.html

But it's not as similar as I thought, but their description still could provide a starting
point.  (I much prefer their XmlDataSet format.)

Re-reading their documentation made me wonder, can you specify nulls with ddlUtils' data file
format?


Rusty Wright wrote:
&gt; Thanks; I didn't see that.
&gt; 
&gt; 1) I still think it would be nice if the format could be documented on 
&gt; the ddlutils web site, obviously in a non-specific way but also with a 
&gt; specific simple example.  It seems to me that it's very similar to 
&gt; DbUnit's non-verbose format so you could use their explanation as a 
&gt; starting point.
&gt; 
&gt; 2) The documentation for writeDtdToFile says "This sub task does not 
&gt; require a database connection, so the dataSource sub element of the 
&gt; enclosing task can be omitted." which is incorrect, it does require a 
&gt; connection, and, to split hairs over terminology, it should say 
&gt; "database sub element" instead "dataSource sub element" since the xml 
&gt; tag it's referring to is &lt;database&gt; and not &lt;dataSource&gt;.
&gt; 
&gt; Thanks again.
&gt; 
&gt; 
&gt; Thomas Dudziak wrote:
&gt;&gt; On Tue, Mar 24, 2009 at 1:26 PM, Rusty Wright &lt;rusty.wright@gmail.com&gt; 
&gt;&gt; wrote:
&gt;&gt;
&gt;&gt;&gt; No, sorry, that doesn't help.  I looked again on the torque site and 
&gt;&gt;&gt; can't
&gt;&gt;&gt; find the documentation for the data load file.
&gt;&gt;&gt;
&gt;&gt;&gt; The two urls you gave are for the database schema; I'm asking about 
&gt;&gt;&gt; the data
&gt;&gt;&gt; file where you load data into the database using the writeDataToDatabase
&gt;&gt;&gt; tag, after it's created the tables.
&gt;&gt;&gt;
&gt;&gt;&gt; I managed to figure it out by searching the mailing list archives, 
&gt;&gt;&gt; but it
&gt;&gt;&gt; seems quite odd to me that it's apparently completely undocumented.
&gt;&gt;
&gt;&gt; The format for the data file is not fixed, it depends on the schema.
&gt;&gt; There is an Ant task that will generate a data file DTD for a
&gt;&gt; particular schema:
&gt;&gt;
&gt;&gt; http://db.apache.org/ddlutils/ant/org.apache.ddlutils.task.WriteDtdToFileCommand.html

&gt;&gt;
&gt;&gt;
&gt;&gt; Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: xml data file format?</title>
<author><name>Rusty Wright &lt;rusty.wright@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200903.mbox/%3c49C9B82F.7070206@gmail.com%3e"/>
<id>urn:uuid:%3c49C9B82F-7070206@gmail-com%3e</id>
<updated>2009-03-25T04:50:55Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks; I didn't see that.

1) I still think it would be nice if the format could be documented on the ddlutils web site,
obviously in a non-specific way but also with a specific simple example.  It seems to me that
it's very similar to DbUnit's non-verbose format so you could use their explanation as a starting
point.

2) The documentation for writeDtdToFile says "This sub task does not require a database connection,
so the dataSource sub element of the enclosing task can be omitted." which is incorrect, it
does require a connection, and, to split hairs over terminology, it should say "database sub
element" instead "dataSource sub element" since the xml tag it's referring to is &lt;database&gt;
and not &lt;dataSource&gt;.

Thanks again.


Thomas Dudziak wrote:
&gt; On Tue, Mar 24, 2009 at 1:26 PM, Rusty Wright &lt;rusty.wright@gmail.com&gt; wrote:
&gt; 
&gt;&gt; No, sorry, that doesn't help.  I looked again on the torque site and can't
&gt;&gt; find the documentation for the data load file.
&gt;&gt;
&gt;&gt; The two urls you gave are for the database schema; I'm asking about the data
&gt;&gt; file where you load data into the database using the writeDataToDatabase
&gt;&gt; tag, after it's created the tables.
&gt;&gt;
&gt;&gt; I managed to figure it out by searching the mailing list archives, but it
&gt;&gt; seems quite odd to me that it's apparently completely undocumented.
&gt; 
&gt; The format for the data file is not fixed, it depends on the schema.
&gt; There is an Ant task that will generate a data file DTD for a
&gt; particular schema:
&gt; 
&gt; http://db.apache.org/ddlutils/ant/org.apache.ddlutils.task.WriteDtdToFileCommand.html
&gt; 
&gt; Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: xml data file format?</title>
<author><name>Thomas Dudziak &lt;tomdzk@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200903.mbox/%3c224f32340903241339j6571780eif37ce5be33410a22@mail.gmail.com%3e"/>
<id>urn:uuid:%3c224f32340903241339j6571780eif37ce5be33410a22@mail-gmail-com%3e</id>
<updated>2009-03-24T20:39:06Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Tue, Mar 24, 2009 at 1:26 PM, Rusty Wright &lt;rusty.wright@gmail.com&gt; wrote:

&gt; No, sorry, that doesn't help. Â I looked again on the torque site and can't
&gt; find the documentation for the data load file.
&gt;
&gt; The two urls you gave are for the database schema; I'm asking about the data
&gt; file where you load data into the database using the writeDataToDatabase
&gt; tag, after it's created the tables.
&gt;
&gt; I managed to figure it out by searching the mailing list archives, but it
&gt; seems quite odd to me that it's apparently completely undocumented.

The format for the data file is not fixed, it depends on the schema.
There is an Ant task that will generate a data file DTD for a
particular schema:

http://db.apache.org/ddlutils/ant/org.apache.ddlutils.task.WriteDtdToFileCommand.html

Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: xml data file format?</title>
<author><name>Rusty Wright &lt;rusty.wright@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200903.mbox/%3c49C941EF.2070906@gmail.com%3e"/>
<id>urn:uuid:%3c49C941EF-2070906@gmail-com%3e</id>
<updated>2009-03-24T20:26:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
No, sorry, that doesn't help.  I looked again on the torque site and can't find the documentation
for the data load file.

The two urls you gave are for the database schema; I'm asking about the data file where you
load data into the database using the writeDataToDatabase tag, after it's created the tables.

I managed to figure it out by searching the mailing list archives, but it seems quite odd
to me that it's apparently completely undocumented.


Rijk van Haaften wrote:
&gt; 2009/3/24 Rusty Wright &lt;rusty.wright@gmail.com&gt;:
&gt;&gt; Where is the documentation for the format of the data file that's used by
&gt;&gt; the  writeDataToDatabase command?
&gt; In the menu, I see "The XML schema format", leading to
&gt;     http://db.apache.org/ddlutils/schema/database.dtd.html
&gt; and
&gt;     http://db.apache.org/ddlutils/schema/database.dtd.org.html
&gt; ?
&gt; 
&gt; Moreover, from the documentation on the main page
&gt; (http://db.apache.org/ddlutils/),
&gt; "DdlUtils uses the Turbine XML format, which is shared by Torque and OJB."
&gt; You can look in the documentation of those projects for information about
&gt; the xml format too.
&gt; 
&gt; Does that help enough?
&gt; 
&gt; Rijk van Haaften


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: xml data file format?</title>
<author><name>Rijk van Haaften &lt;r.j.c.vanhaaften@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200903.mbox/%3ccac75f980903241232i7f8d433cmf46af275fa7ba370@mail.gmail.com%3e"/>
<id>urn:uuid:%3ccac75f980903241232i7f8d433cmf46af275fa7ba370@mail-gmail-com%3e</id>
<updated>2009-03-24T19:32:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
2009/3/24 Rusty Wright &lt;rusty.wright@gmail.com&gt;:
&gt; Where is the documentation for the format of the data file that's used by
&gt; the Â writeDataToDatabase command?
In the menu, I see "The XML schema format", leading to
    http://db.apache.org/ddlutils/schema/database.dtd.html
and
    http://db.apache.org/ddlutils/schema/database.dtd.org.html
?

Moreover, from the documentation on the main page
(http://db.apache.org/ddlutils/),
"DdlUtils uses the Turbine XML format, which is shared by Torque and OJB."
You can look in the documentation of those projects for information about
the xml format too.

Does that help enough?

Rijk van Haaften


</pre>
</div>
</content>
</entry>
<entry>
<title>xml data file format?</title>
<author><name>Rusty Wright &lt;rusty.wright@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200903.mbox/%3c49C90F84.50802@gmail.com%3e"/>
<id>urn:uuid:%3c49C90F84-50802@gmail-com%3e</id>
<updated>2009-03-24T16:51:16Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Where is the documentation for the format of the data file that's used by the  writeDataToDatabase
command?  I've looked on
http://db.apache.org/ddlutils/ant/org.apache.ddlutils.task.WriteDataToDatabaseCommand.html
and
http://db.apache.org/ddlutils/api/org/apache/ddlutils/task/WriteDataToDatabaseCommand.html
but I can't find it anywhere.  It seems to be cleverly hidden somewhere that I'm not looking.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Using DDLUtils with h2database</title>
<author><name>Thomas Dudziak &lt;tomdzk@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200901.mbox/%3c224f32340901280138m70da594fv4862f126354d5f6d@mail.gmail.com%3e"/>
<id>urn:uuid:%3c224f32340901280138m70da594fv4862f126354d5f6d@mail-gmail-com%3e</id>
<updated>2009-01-28T09:38:46Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Mon, Jan 26, 2009 at 12:11 AM, pmendelson2 &lt;mendelson.paul@gmail.com&gt; wrote:

&gt; I would like to use ddlutils to seed and capture data from an h2 database.  I
&gt; see that support for H2 is slotted for release 1.3.  I also see that there
&gt; is a major 1.1 release that simplifies the dbms plugin mechanism.
&gt;
&gt; If I need to use DDLUtils with h2 today which branch should I download and
&gt; try to hack into?

You should checkout trunk, and start with copying the hsqldb platform
classes which should be relatively similar. The steps then would be

* get the unit tests running against an H2 database
* fix the broken unit tests one by one

For the purpose of the above, it is easier to work with an external H2
database server instead of using it embedded.

hope that helps,
Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>Using DDLUtils with h2database</title>
<author><name>pmendelson2 &lt;mendelson.paul@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200901.mbox/%3c21658131.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c21658131-post@talk-nabble-com%3e</id>
<updated>2009-01-25T23:11:26Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

I would like to use ddlutils to seed and capture data from an h2 database.  I
see that support for H2 is slotted for release 1.3.  I also see that there
is a major 1.1 release that simplifies the dbms plugin mechanism.

If I need to use DDLUtils with h2 today which branch should I download and
try to hack into?
-- 
View this message in context: http://www.nabble.com/Using-DDLUtils-with-h2database-tp21658131p21658131.html
Sent from the Apache DdlUtils - User mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Export data/schema from only certain tables ??</title>
<author><name>James Yu &lt;cyu021@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200901.mbox/%3c60bb95410901201921g76b67b50w7796aeb578ef04bb@mail.gmail.com%3e"/>
<id>urn:uuid:%3c60bb95410901201921g76b67b50w7796aeb578ef04bb@mail-gmail-com%3e</id>
<updated>2009-01-21T03:21:09Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi all,

In writeDataToFile's document, I don't see any nested elements to specify
which tables the data should be dumped from.
Is there a way (and how) to export data from just certain tables ??

Besides, I am not sure if the previous help requesting email got through.
Let me post it again.

Instead of exporting all tables, I tried to just export certain tables out
of a DB.
I read through DdlUtils' web page and still don't have any clue on how to
use "TableSpecificParameter".

Followings are the sneppits of my XML and the result of execution:
Maybe I didn't understand the material right, please correct me.

     17             &lt;writeSchemaToFile outputFile="db-schema.xml"&gt;
     18                 &lt;tableSpecificParameter table="foak_user_profile"/&gt;
     19             &lt;/writeSchemaToFile&gt;
BUILD FAILED
[blah] writeSchemaToFile doesn't support the nested "tableSpecificParameter"
element.

     17             &lt;writeSchemaToFile outputFile="db-schema.xml"&gt;
     18                 &lt;parameter table="user_profile"/&gt;
     19             &lt;/writeSchemaToFile&gt;
BUILD FAILED
[blah] writeSchemaToFile doesn't support the nested "parameter" element

-- 
This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu
+886988713275


</pre>
</div>
</content>
</entry>
<entry>
<title>Error from database to DDL</title>
<author><name>Mark Robinson &lt;mark.robinson@mizar.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200901.mbox/%3c49760ACB.5050802@mizar.com%3e"/>
<id>urn:uuid:%3c49760ACB-5050802@mizar-com%3e</id>
<updated>2009-01-20T17:32:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi All,

I'm trying to do a schema export from my database but I keep getting 
this error.

db.xml:16: Could not read the schema from the specified database: 
Database type Oracle is not supported.

Here is my ant file:

&lt;project default="database-dump"&gt;
&lt;path id="runtime-classpath"&gt;
  &lt;fileset dir="../public_html/WEB-INF/lib"&gt;
    &lt;include name="*.jar"/&gt;
  &lt;/fileset&gt;
&lt;/path&gt;
&lt;target name="database-dump" description="Dumps the database structure"&gt;
  &lt;taskdef name="databaseToDdl"
           classname="org.apache.ddlutils.task.DatabaseToDdlTask"&gt;
    &lt;classpath refid="runtime-classpath"/&gt;
  &lt;/taskdef&gt;
  &lt;databaseToDdl verbosity="DEBUG" modelName="MyModel"  &gt;
    &lt;database url="jdbc:oracle:thin:@localhost:1521:dev5"
              driverClassName="oracle.jdbc.OracleDriver"
              username="cpc"
              password="cpc"/&gt;

    &lt;writeSchemaToFile outputFile="db-schema.xml"/&gt;
  &lt;/databaseToDdl&gt;
&lt;/target&gt;
&lt;/project&gt;


Does anyone know why this might be happening?  What am I doing wrong?


Mark

-- 
Mark Robinson - Mizar LLC
mark.robinson@mizar.com
111-1010 McKenzie Ave.
Victoria, BC
V8X 4B2
(250) 588-8321



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Problem with importing BLOB data</title>
<author><name>&quot;Thomas Dudziak&quot; &lt;tomdzk@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200901.mbox/%3c224f32340901031843t584d775auf2b5553549cb3776@mail.gmail.com%3e"/>
<id>urn:uuid:%3c224f32340901031843t584d775auf2b5553549cb3776@mail-gmail-com%3e</id>
<updated>2009-01-04T02:43:28Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Fri, Jan 2, 2009 at 1:03 AM, Marcel Wagner &lt;marcel.wagner@gmx.de&gt; wrote:

&gt; I have some trouble with DdlUtils 1.0 and also trunk. I can't get BLOB data
&gt; imported. I always get
&gt;
&gt; Caused by: java.sql.SQLException: Connection is closed.
&gt;   at
&gt; org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.checkOpen(PoolingDataSource.java:175)
&gt;   at
&gt; org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:180)
&gt;   at
&gt; org.apache.ddlutils.io.DataToDatabaseSink.end(DataToDatabaseSink.java:217)
&gt;   ... 19 more
&gt;
&gt; As an attachment the schema and data, where the exception occures. Any idea,
&gt; what is the problem??? Verified with MySql and DerbyDB

This error looks like the connection timed out on the database side.
How is the data source configured ? Do you have a validation query ?

Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>Problem with importing BLOB data</title>
<author><name>Marcel Wagner &lt;marcel.wagner@gmx.de&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200901.mbox/%3c495DD879.3030000@gmx.de%3e"/>
<id>urn:uuid:%3c495DD879-3030000@gmx-de%3e</id>
<updated>2009-01-02T09:03:53Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

I have some trouble with DdlUtils 1.0 and also trunk. I can't get BLOB 
data imported. I always get

Caused by: java.sql.SQLException: Connection is closed.
    at 
org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.checkOpen(PoolingDataSource.java:175)
    at 
org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:180)
    at 
org.apache.ddlutils.io.DataToDatabaseSink.end(DataToDatabaseSink.java:217)
    ... 19 more

As an attachment the schema and data, where the exception occures. Any 
idea, what is the problem??? Verified with MySql and DerbyDB

Thanks for the help,

Marcel



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: excludetables problem and have a fix</title>
<author><name>&quot;Thomas Dudziak&quot; &lt;tomdzk@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200811.mbox/%3c224f32340811281521g355ed855w8c402d597dccaad5@mail.gmail.com%3e"/>
<id>urn:uuid:%3c224f32340811281521g355ed855w8c402d597dccaad5@mail-gmail-com%3e</id>
<updated>2008-11-28T23:21:31Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Heng,

please file an issue with DdlUtils JIRA
(http://issues.apache.org/jira/secure/BrowseProject.jspa?id=10731) for
this. If you have a patch or unit tests for this, please also attach
them to the JIRA issue.

thanks,
Tom

On Wed, Nov 26, 2008 at 8:30 AM, Heng Chu &lt;hengchu@hotmail.com&gt; wrote:
&gt;
&gt; First of all, thanks for this wonderful utility. Very useful w/ a lot of good
&gt; features. I recently found a problem in ddlutils (latest code in SVN) and
&gt; have a fix. I am not sure how I can contribute the fix back to the DdlUtils
&gt; project team.
&gt;
&gt; Here is the problem: I use excludetables in the DdlUtils Ant task
&gt; org.apache.ddlutils.task.DatabaseToDdlTask. Some of the tables listed have
&gt; foreigh keys to other tables in the DB. I got an error on writeSchemaToFile
&gt; complaining about this which should be ok.
&gt;
&gt; Here is the fix: In org.apache.ddlutils.task.DatabaseToDdlTask, the
&gt; readModel() method calls the
&gt; ModelHelper.checkForForeignKeysToAndFromTables() in both the exclude and
&gt; include cases. That method, as currently implemented, throws an exception if
&gt; (1) a table in the (exclude or include) list has a foreign key to a table
&gt; not on the list, OR, (2) a table not on the list has a foreign key into a
&gt; table in the (exclude or include) list. This is too strict a check and could
&gt; stop some legit cases -- my problem is actually due to chec (1) which is ok
&gt; in exclude case. This method should be split into two. For the include case,
&gt; just check (1) and for excluse case, just check (2). I made the
&gt; straightfoward change in my local copy and things went ok. I just want to
&gt; report this and hope it's fixed in the near future. Thanks!
&gt;
&gt; Heng
&gt; --
&gt; View this message in context: http://www.nabble.com/excludetables-problem-and-have-a-fix-tp20704354p20704354.html
&gt; Sent from the Apache DdlUtils - User mailing list archive at Nabble.com.
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>excludetables problem and have a fix</title>
<author><name>Heng Chu &lt;hengchu@hotmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200811.mbox/%3c20704354.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c20704354-post@talk-nabble-com%3e</id>
<updated>2008-11-26T16:30:33Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

First of all, thanks for this wonderful utility. Very useful w/ a lot of good
features. I recently found a problem in ddlutils (latest code in SVN) and
have a fix. I am not sure how I can contribute the fix back to the DdlUtils
project team. 

Here is the problem: I use excludetables in the DdlUtils Ant task
org.apache.ddlutils.task.DatabaseToDdlTask. Some of the tables listed have
foreigh keys to other tables in the DB. I got an error on writeSchemaToFile
complaining about this which should be ok. 

Here is the fix: In org.apache.ddlutils.task.DatabaseToDdlTask, the
readModel() method calls the
ModelHelper.checkForForeignKeysToAndFromTables() in both the exclude and
include cases. That method, as currently implemented, throws an exception if
(1) a table in the (exclude or include) list has a foreign key to a table
not on the list, OR, (2) a table not on the list has a foreign key into a
table in the (exclude or include) list. This is too strict a check and could
stop some legit cases -- my problem is actually due to chec (1) which is ok
in exclude case. This method should be split into two. For the include case,
just check (1) and for excluse case, just check (2). I made the
straightfoward change in my local copy and things went ok. I just want to
report this and hope it's fixed in the near future. Thanks!

Heng
-- 
View this message in context: http://www.nabble.com/excludetables-problem-and-have-a-fix-tp20704354p20704354.html
Sent from the Apache DdlUtils - User mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>databaseToDdl from db2 problems with schema</title>
<author><name>&quot;Ihrig, Jens \(Key-Work\)&quot; &lt;jens.ihrig@key-work.de&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200811.mbox/%3c21339CA99F776F4788A2EB682B842B7E013D448D@ex1.office.key-work.de%3e"/>
<id>urn:uuid:%3c21339CA99F776F4788A2EB682B842B7E013D448D@ex1-office-key-work-de%3e</id>
<updated>2008-11-18T16:53:57Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

i have a problem exporting the database structure of ONE schema (called ags) from a db2 database
(v8) via ant.
The database contains different schemata. If I set the schemapattern parameter to "ags" the
result is an empty .xml oder *.sql file.
if i don´t set the parameter, the task tries to receive data form all tables of all schemas,
but
appends the username "extranet" instead of the right schema prefix. which leads to an error
as this schema doesnt exist and the tables 
are realy in other schemas.

C:\sources\ags_extranet\build.xml:299: Could not read the schema from the specified database:
COM.ibm.db2.jdbc.DB2Exception: 
[IBM][CLI Driver][DB2/NT] SQL0204N  "EXTRANET.ACT_DYN_DATE_CURVE" ist ein nicht definierter
Name.  SQLSTATE=42704

("ist ein nicht definierter Name" german for non-defined name)

if anybody has an idea, i would be very thankfull!

wbr
jens ihrig

&lt;target name="dump-database" description="Dumps the database structure"&gt;  
		
		&lt;echo message="Dump the database structure"/&gt;
		
		&lt;tstamp&gt;
			&lt;format property="fileNamePrefix" pattern="yyyy-MM-dd_HH-mm-ss_" /&gt;
		&lt;/tstamp&gt;	
		
		&lt;echo message="using java libraries from: ${java.lib.path}"/&gt;

		&lt;path id="runtime-classpath"&gt;
		  &lt;fileset dir="${java.lib.path}"&gt;
		    &lt;include name="**/*.jar"/&gt;
		    &lt;include name="**/*.zip"/&gt;
		  &lt;/fileset&gt;
		&lt;/path&gt;	

		&lt;taskdef classname="org.apache.ddlutils.task.DatabaseToDdlTask"
		           name="databaseToDdl"
		           classpathref="runtime-classpath" 
		 /&gt;
	
		&lt;databaseToDdl 
			verbosity="DEBUG"  
			modelname="ags"
			tabletypes="TABLE"
			schemapattern="ags"	
		&gt;
			    &lt;database	url="jdbc:db2:ags_ex"
			              	driverClassName="COM.ibm.db2.jdbc.app.DB2Driver"
			              	username="extranet"
			              	password="********"
			    /&gt;

			    &lt;writeSchemaToFile outputFile="${database-dump.path}${fileNamePrefix}db_schema.xml"/&gt;
			&lt;writeSchemaSqlToFile outputFile="${database-dump.path}${fileNamePrefix}db_schema.sql"/&gt;
	  &lt;/databaseToDdl&gt;
	

	&lt;/target&gt;

Jens Ihrig 
Key-Work Consulting GmbH | Kriegsstr. 100 | 76133 Karlsruhe | Germany | www.key-work.de
Fon: +49-721-78203-15 | E-Mail: jens.ihrig@key-work.de | Fax: +49-721-78203-10

Key-Work Consulting GmbH Karlsruhe, HRB 108695, HRG Mannheim
Geschäftsführer: Andreas Stappert, Tobin Wotring


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: read data from database</title>
<author><name>Erik Drolshammer &lt;erik.drolshammer@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200809.mbox/%3c48DB2F57.30306@gmail.com%3e"/>
<id>urn:uuid:%3c48DB2F57-30306@gmail-com%3e</id>
<updated>2008-09-25T06:27:35Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Anas Mughal wrote:
&gt; What database were you using?

Oracle 10.

-- 
Best regards
Erik



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: read data from database</title>
<author><name>Erik Drolshammer &lt;erik.drolshammer@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200809.mbox/%3c48DB27A4.8040106@gmail.com%3e"/>
<id>urn:uuid:%3c48DB27A4-8040106@gmail-com%3e</id>
<updated>2008-09-25T05:54:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thomas Dudziak wrote:
&gt; On Wed, Sep 24, 2008 at 1:00 AM, Erik Drolshammer
&gt; &lt;erik.drolshammer@gmail.com&gt; wrote:
&gt; 
&gt;&gt; I have successfully  made a dump from an existing database with
&gt;&gt; readModelFromDatabase. (So my setup seems to work.)
&gt;&gt;
&gt;&gt; How can I do the same for the data?
&gt; 
&gt; For API samples, see http://db.apache.org/ddlutils/api-usage.html, and
&gt; also the javadoc for the DatabaseDataIO class
&gt; (http://db.apache.org/ddlutils/api/org/apache/ddlutils/io/DatabaseDataIO.html).

1. The following gives no errors, but no data is written to data.xml.

DatabaseDataIO databaseDataIO = new DatabaseDataIO();
String xmlEncoding = "UTF-8";
databaseDataIO.writeDataToXML(oracle10Platform, oracleDatabase, 
"data.xml", xmlEncoding);


2.
DatabaseDataIO databaseDataIO = new DatabaseDataIO();
String xmlEncoding = "UTF-8";
databaseDataIO.writeDataToXML(oracle10Platform, "data.xml", xmlEncoding);

gives the following error:


org.apache.ddlutils.DatabaseOperationException: Error while performing a 
query
	at 
org.apache.ddlutils.platform.PlatformImplBase.query(PlatformImplBase.java:899)
	at 
org.apache.ddlutils.io.DatabaseDataIO.writeDataForTableToXML(DatabaseDataIO.java:538)
	at 
org.apache.ddlutils.io.DatabaseDataIO.writeDataToXML(DatabaseDataIO.java:381)
	at 
org.apache.ddlutils.io.DatabaseDataIO.writeDataToXML(DatabaseDataIO.java:359)
	at 
org.apache.ddlutils.io.DatabaseDataIO.writeDataToXML(DatabaseDataIO.java:279)

Caused by: java.sql.SQLException: ORA-00942: table or view does not 
exist  at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
	at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
	at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
	at 
oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:801)
	at 
oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
	at 
oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:841)
	at 
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)
	at 
oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1274)
	at 
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
	at 
org.apache.ddlutils.platform.PlatformImplBase.query(PlatformImplBase.java:893)
	... 34 more


I have checked with an external tool (SqlDeveloper) that some of the 
tables contain data. In tips?


-- 
Best regards
Erik Drolshammer



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: read data from database</title>
<author><name>&quot;Thomas Dudziak&quot; &lt;tomdzk@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200809.mbox/%3c224f32340809240853s3c1c4b4ajdd4130819c14f915@mail.gmail.com%3e"/>
<id>urn:uuid:%3c224f32340809240853s3c1c4b4ajdd4130819c14f915@mail-gmail-com%3e</id>
<updated>2008-09-24T15:53:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Wed, Sep 24, 2008 at 1:00 AM, Erik Drolshammer
&lt;erik.drolshammer@gmail.com&gt; wrote:

&gt; I have successfully  made a dump from an existing database with
&gt; readModelFromDatabase. (So my setup seems to work.)
&gt;
&gt; How can I do the same for the data?

For API samples, see http://db.apache.org/ddlutils/api-usage.html, and
also the javadoc for the DatabaseDataIO class
(http://db.apache.org/ddlutils/api/org/apache/ddlutils/io/DatabaseDataIO.html).

For Ant, have a look at the writedatatofile command of the
databaseToDdl Ant task (http://db.apache.org/ddlutils/ant/).

Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>RE: read data from database</title>
<author><name>&quot;Anas Mughal&quot; &lt;anas.mughal@bluenog.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200809.mbox/%3c001a01c91e57$891591d0$9b40b570$@mughal@bluenog.com%3e"/>
<id>urn:uuid:%3c001a01c91e57$891591d0$9b40b570$@mughal@bluenog-com%3e</id>
<updated>2008-09-24T15:09:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
What database were you using?
Thanks.

--
Anas Mughal
Bluenog



-----Original Message-----
From: Erik Drolshammer [mailto:erik.drolshammer@gmail.com] 
Sent: Wednesday, September 24, 2008 4:01 AM
To: ddlutils-user@db.apache.org
Subject: read data from database

Hi!
I have successfully  made a dump from an existing database with 
readModelFromDatabase. (So my setup seems to work.)

How can I do the same for the data?


-- 
Best regards
Erik Drolshammer








</pre>
</div>
</content>
</entry>
<entry>
<title>read data from database</title>
<author><name>Erik Drolshammer &lt;erik.drolshammer@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200809.mbox/%3c48D9F3BB.7050008@gmail.com%3e"/>
<id>urn:uuid:%3c48D9F3BB-7050008@gmail-com%3e</id>
<updated>2008-09-24T08:00:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi!
I have successfully  made a dump from an existing database with 
readModelFromDatabase. (So my setup seems to work.)

How can I do the same for the data?


-- 
Best regards
Erik Drolshammer







</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Use DdlUtils to maintain a ddl than can be shared between Oracle and Derby</title>
<author><name>=?ISO-8859-1?Q?Daniel_L=F3pez?= &lt;D.Lopez@uib.es&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200809.mbox/%3c48C7A1DE.5080000@uib.es%3e"/>
<id>urn:uuid:%3c48C7A1DE-5080000@uib-es%3e</id>
<updated>2008-09-10T10:30:54Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

Waht we basically do is to call the databaseToDdl Ant task to generate 
the XML from the DB schema, and then there is another task called 
ddlToDatabase that reads the XML of a DB and is *supposedly* able to 
generate the schema, generating the appropariate DDL statements for the 
database. I say supposedly because we don't use the second task :).

You can find the information and some examples on using the tasks here:
http://db.apache.org/ddlutils/ant/

Maybe looking at the source code of both tasks, you can come up with a 
way to short-circuit what they do and do it in one pass.

Good luck!
D.


Erik Drolshammer escribió:
&gt; Daniel López wrote:
&gt;&gt; With DDLUtils, you can also export the database schema to an XML 
&gt;&gt; database independent format, so I guess that if not direcly, you could 
&gt;&gt; at least export the schema from oracle to the XML format and then from 
&gt;&gt; the XML to Derby.
&gt;&gt; There probably is a way of doing the same process programatically, but 
&gt;&gt; I just use DDLUtils through the Ant tasks, so I don't have experience 
&gt;&gt; with that. But just so you know there is at least one way of doing it.
&gt; 
&gt; This is exactly what I'm looking for. Could you provide some more 
&gt; details as to how it can be done?
&gt; (The ant task approach might or might not be the approach I choose to 
&gt; use, but at least it gives me the parameters and perhaps pointers to 
&gt; which code that support this.)
&gt; 


-- 
-------------------------------------------
Daniel Lopez Janariz (D.Lopez@uib.es)
Web Services
Centre for Information and Technology
Balearic Islands University
(SPAIN)
-------------------------------------------


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Use DdlUtils to maintain a ddl than can be shared between Oracle and Derby</title>
<author><name>Erik Drolshammer &lt;erik.drolshammer@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200809.mbox/%3c48C784CF.6030807@gmail.com%3e"/>
<id>urn:uuid:%3c48C784CF-6030807@gmail-com%3e</id>
<updated>2008-09-10T08:26:55Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Daniel López wrote:
&gt; With DDLUtils, you can also export the database schema to an XML 
&gt; database independent format, so I guess that if not direcly, you could 
&gt; at least export the schema from oracle to the XML format and then from 
&gt; the XML to Derby.
&gt; There probably is a way of doing the same process programatically, but I 
&gt; just use DDLUtils through the Ant tasks, so I don't have experience with 
&gt; that. But just so you know there is at least one way of doing it.

This is exactly what I'm looking for. Could you provide some more 
details as to how it can be done?
(The ant task approach might or might not be the approach I choose to 
use, but at least it gives me the parameters and perhaps pointers to 
which code that support this.)

-- 
Best regards
Erik Drolshammer



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Use DdlUtils to maintain a ddl than can be shared between Oracle and Derby</title>
<author><name>=?ISO-8859-1?Q?Daniel_L=F3pez?= &lt;D.Lopez@uib.es&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200809.mbox/%3c48C7811A.3050405@uib.es%3e"/>
<id>urn:uuid:%3c48C7811A-3050405@uib-es%3e</id>
<updated>2008-09-10T08:11:06Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

With DDLUtils, you can also export the database schema to an XML 
database independent format, so I guess that if not direcly, you could 
at least export the schema from oracle to the XML format and then from 
the XML to Derby.
There probably is a way of doing the same process programatically, but I 
just use DDLUtils through the Ant tasks, so I don't have experience with 
that. But just so you know there is at least one way of doing it.

S!
D.


Erik Drolshammer escribió:
&gt; Hi!
&gt; I want to use Derby as an in-mem substitute for Oracle for automatic 
&gt; testing purposes.
&gt; 
&gt; I have successfully exported the schema from an existing Oracle schema 
&gt; (without data) to a ddl-file, but when I try to create tables etc. in 
&gt; Derby I run into problems.
&gt; 
&gt; Does DdlUtils support some sort of automatic conversion between 
&gt; "Oracle-sql" and "Derby-sql"?
&gt; Or must I manually convert e.g. Oracle's "varchar2" to Derby's "varchar?
&gt; 
&gt; 
&gt; This is the setup I currently use:
&gt; 
&gt; //Create ddl from Oracle database
&gt; Oracle10Platform oracle10Platform = new Oracle10Platform();
&gt; oracle10Platform.setDataSource(dataSource);
&gt; Database database = oracle10Platform.readModelFromDatabase(name, 
&gt; catalog, schema, tableTypes);
&gt; 
&gt; 
&gt; //Create Derby tables from Oracle ddl source
&gt; oracle10Platform.createTables(conn, database, 
&gt; dropTablesFirst,continueOnError);



</pre>
</div>
</content>
</entry>
<entry>
<title>Use DdlUtils to maintain a ddl than can be shared between Oracle and Derby</title>
<author><name>Erik Drolshammer &lt;erik.drolshammer@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200809.mbox/%3c48C77149.8030500@gmail.com%3e"/>
<id>urn:uuid:%3c48C77149-8030500@gmail-com%3e</id>
<updated>2008-09-10T07:03:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi!
I want to use Derby as an in-mem substitute for Oracle for automatic 
testing purposes.

I have successfully exported the schema from an existing Oracle schema 
(without data) to a ddl-file, but when I try to create tables etc. in 
Derby I run into problems.

Does DdlUtils support some sort of automatic conversion between 
"Oracle-sql" and "Derby-sql"?
Or must I manually convert e.g. Oracle's "varchar2" to Derby's "varchar?


This is the setup I currently use:

//Create ddl from Oracle database
Oracle10Platform oracle10Platform = new Oracle10Platform();
oracle10Platform.setDataSource(dataSource);
Database database = oracle10Platform.readModelFromDatabase(name, 
catalog, schema, tableTypes);


//Create Derby tables from Oracle ddl source
oracle10Platform.createTables(conn, database, 
dropTablesFirst,continueOnError);


-- 
Best regards
Erik Drolshammer



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Inconsistency?</title>
<author><name>&quot;Thomas Dudziak&quot; &lt;tomdzk@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200806.mbox/%3c224f32340806091945y3dff43ffwd9aaf94c03b82e32@mail.gmail.com%3e"/>
<id>urn:uuid:%3c224f32340806091945y3dff43ffwd9aaf94c03b82e32@mail-gmail-com%3e</id>
<updated>2008-06-10T02:45:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Mon, Jun 9, 2008 at 4:24 AM, Rijk van Haaften
&lt;r.j.c.vanhaaften@gmail.com&gt; wrote:

&gt; Is there a (good?) reason for this:
&gt; Table.findColumn(String)
&gt; Table.findIndex(String)
&gt; but
&gt; Table.findForeignKey(ForeignKey)

The reason is that foreign keys are not required to have a name.
However, you're right, there is no reason to not provide a
findForeignKey method that takes a name for easier access to foreign
keys that have a name (feel free to create a JIRA issue for this).

Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>Inconsistency?</title>
<author><name>&quot;Rijk van Haaften&quot; &lt;r.j.c.vanhaaften@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200806.mbox/%3ccac75f980806090424td59f466w47443e6f60982a17@mail.gmail.com%3e"/>
<id>urn:uuid:%3ccac75f980806090424td59f466w47443e6f60982a17@mail-gmail-com%3e</id>
<updated>2008-06-09T11:24:45Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Dear all,

Is there a (good?) reason for this:
Table.findColumn(String)
Table.findIndex(String)
but
Table.findForeignKey(ForeignKey)
?

-- 
Rijk J.C. van Haaften

Klaas Kloosterweg West 9a
7954 PR Rouveen
0522-291159
06-49416002


</pre>
</div>
</content>
</entry>
<entry>
<title>Table changes &amp; Sequences</title>
<author><name>&quot;Rijk van Haaften&quot; &lt;r.j.c.vanhaaften@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200806.mbox/%3ccac75f980806030342y77a797a6q88535dbd96a2a380@mail.gmail.com%3e"/>
<id>urn:uuid:%3ccac75f980806030342y77a797a6q88535dbd96a2a380@mail-gmail-com%3e</id>
<updated>2008-06-03T10:42:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi all,

When I apply a table change on a table that uses auto-increment (I use
postgresql which implements auto-incr. with sequences) the sequences
are reset. I suspect a RecreateTableChange that recreates the table
using a temporary table to migrate the data but doesn't migrate the
sequence. Is this a bug, or should I use the api in a different way?

-- 
Rijk J.C. van Haaften

Klaas Kloosterweg West 9a
7954 PR Rouveen
0522-291159
06-49416002


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: No output from writeSchemaSqlTofile command</title>
<author><name>&quot;Thomas Dudziak&quot; &lt;tomdzk@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200805.mbox/%3c224f32340805280911r4f89683dy637782962ab4bcb6@mail.gmail.com%3e"/>
<id>urn:uuid:%3c224f32340805280911r4f89683dy637782962ab4bcb6@mail-gmail-com%3e</id>
<updated>2008-05-28T16:11:40Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Sat, May 24, 2008 at 4:55 PM, Hacking Bear &lt;hackingbear@gmail.com&gt; wrote:

&gt; I'm new to dbUtils and i cannot find answers to my question. Please help me.
&gt;
&gt; I want to export my schema to SQL DDL from SQL Server but the output sql
&gt; file is empty (even though the XML schema file has valid data.) Apparently,
&gt; my task, connection, etc. works. Only the generated SQL file is empty. any
&gt; idea?

That is odd. Could you try running the writeSchemaSqlToFile subtask
within the ddlToDatabase task using the ss-schema.xml file that you
got ? That will basically perform the same operation except that it
does not use a live database but the database model contained in the
ss-schema.xml file.

Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>No output from writeSchemaSqlTofile command</title>
<author><name>&quot;Hacking Bear&quot; &lt;hackingbear@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ddlutils-user/200805.mbox/%3c3feb1c060805241655ma73a9b7g693dbefd6ffeca8f@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3feb1c060805241655ma73a9b7g693dbefd6ffeca8f@mail-gmail-com%3e</id>
<updated>2008-05-24T23:55:05Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

I'm new to dbUtils and i cannot find answers to my question. Please help me.

I want to export my schema to SQL DDL from SQL Server but the output sql
file is empty (even though the XML schema file has valid data.) Apparently,
my task, connection, etc. works. Only the generated SQL file is empty. any
idea?

Thanks!


My Ant task is

    &lt;target name="db-dump" description="Dumps the database structure"&gt;
      &lt;taskdef name="databaseToDdl"
               classname="org.apache.ddlutils.task.DatabaseToDdlTask"&gt;
        &lt;classpath refid="runtime-classpath"/&gt;
      &lt;/taskdef&gt;
      &lt;databaseToDdl modelName="ss" schemapattern="dbo" verbosity="debug"
        databaseType="mssql"&gt;
        &lt;database url="jdbc:sqlserver://localhost:1433;DatabaseName=avop"

driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
                  username="sa"
                  password="sa"/&gt;
        &lt;writeSchemaToFile outputFile="ss-schema.xml"/&gt;
        &lt;writeSchemaSqlToFile outputFile="ss.sql"/&gt;
      &lt;/databaseToDdl&gt;
    &lt;/target&gt;

running from cygwin bash:

$ ant -lib dist -lib lib ; ls -l *.xml *.sql
Buildfile: build.xml

db-dump:
[databaseToDdl] May 24, 2008 4:50:56 PM
com.microsoft.sqlserver.jdbc.AuthenticationJNI &lt;clinit&gt;
[databaseToDdl] WARNING: Failed to load the sqljdbc_auth.dll
[databaseToDdl] Borrowed connection
org.apache.commons.dbcp.PoolableConnection@54a328 from data source
[databaseToDdl] Returning connection
org.apache.commons.dbcp.PoolableConnection@54a328 to data source.
[databaseToDdl] Remaining connections: None
[databaseToDdl] Written schema to d:\dbutils\ss-schema.xml
[databaseToDdl] Borrowed connection
org.apache.commons.dbcp.PoolableConnection@54a328 from data source
[databaseToDdl] Returning connection
org.apache.commons.dbcp.PoolableConnection@54a328 to data source.
[databaseToDdl] Remaining connections: None
[databaseToDdl] Written schema SQL to d:\dbutils\ss.sql

BUILD SUCCESSFUL
Total time: 7 seconds
---------- 1 me    mkpasswd 49959 May 24 16:51 ss-schema.xml
---------- 1 me    mkpasswd     0 May 24 16:51 ss.sql


</pre>
</div>
</content>
</entry>
</feed>
