db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <tom...@gmail.com>
Subject Re: Problem with reading XML.
Date Wed, 08 Feb 2006 08:04:01 GMT
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