On 2/8/06, Jun Li <[EMAIL PROTECTED]> 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, > "LoggedBy" VARCHAR(50) DEFAULT 'N'iCMS'' NOT NULL, Here's the problem: the default value string contains a single apostroph which also is the quotation sign which naturally gives problems. 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). <snip> > 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 ? Tom
