db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Allan Jun Li <allanju...@gmail.com>
Subject Re: Problem with reading XML.
Date Wed, 08 Feb 2006 09:47:25 GMT
Hi Tom,

So glad to get your response this quickly.
I'll post more info for the first problem tomorrow morning.

Just from my memory, the exception raised for the very first table in the XML file generated,
the table has five columns, the attributes and the values in the XML file look fine (will
post the table schema tomorrow). When I tried to reading the XML file back into a model, the
exception raised as "The column nr 5 in table XXX has no type", I tried to comment out that
column, and then the exception changed to  "The column nr 4 in table XXX has no type".

Another problem that I found was the table generated from the model lost it's relationships.
Will post more info on this.

I'm using SQL Server 2000 with JDBC 2.2.0022.


----- Original Message ----- 
From: "Thomas Dudziak" <tomdzk@gmail.com>
To: <ddlutils-user@db.apache.org>
Sent: Wednesday, February 08, 2006 7:04 PM
Subject: Re: Problem with reading XML.

On 2/8/06, Jun Li <allanjunli@gmail.com> wrote:

> Just tried ddlutils today. The XML it generates from database looks greate.
> But I have problem with reading XML.
> When I was trying to read the XML file generated back to an empty
> database(SQL Server), there are exceptions which say: The column nr 5 in
> table XXX has no type. However, the XML file really had type attribute and
> value for all the columns.

Please post some more info, e.g. the stacktrace and generated model.

> Another problem, I also tied to read a database into model and then write to
> an empty database. The exceptions are as follow.
> Exception in thread "main" *org.apache.ddlutils.DynaSqlException*: Error
> while executing SQL CREATE TABLE "EventSource"
> (
> "EventSourceID" NUMERIC(9,0) NOT NULL,
> "EventSourceTypeFK" NUMERIC(9,0) NOT NULL,
> "Name" VARCHAR(100) NOT NULL,

Here's the problem: the default value string contains a single
apostroph which also is the quotation sign which naturally gives
In short, the apostroph needs to be escaped (DdlUtils does not yet do
that but I have added issue DDLUTILS-66).
If you have control over the schema (its not auto-generated), then for
now please add the escape character yourself in the default value
(sorry, don't now it for Sql Server right now).


> Can anyone give me some confidence that ddlutils really works on SQL Server.
> I mean can create tables, insert records from reading XML file which
> generated from other databases.

I'm currently working on the Sql Server part, should be ready in a
couple of days.
Btw, what version of Sql Server and JDBC driver are you using ?

View raw message