Return-Path: Delivered-To: apmail-db-ddlutils-user-archive@www.apache.org Received: (qmail 2926 invoked from network); 8 Feb 2006 08:04:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Feb 2006 08:04:24 -0000 Received: (qmail 2328 invoked by uid 500); 8 Feb 2006 08:04:24 -0000 Delivered-To: apmail-db-ddlutils-user-archive@db.apache.org Received: (qmail 2303 invoked by uid 500); 8 Feb 2006 08:04:24 -0000 Mailing-List: contact ddlutils-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ddlutils-user@db.apache.org Delivered-To: mailing list ddlutils-user@db.apache.org Received: (qmail 2292 invoked by uid 99); 8 Feb 2006 08:04:24 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2006 00:04:24 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of tomdzk@gmail.com designates 66.249.92.203 as permitted sender) Received: from [66.249.92.203] (HELO uproxy.gmail.com) (66.249.92.203) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2006 00:04:23 -0800 Received: by uproxy.gmail.com with SMTP id o2so246534uge for ; Wed, 08 Feb 2006 00:04:01 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=DP5u0Z1D0bRgcScDJBLYSA7ZmUg32ABmT6pwK2cLr2Q14Ipet2LSKqz8JaSi2u8Iep6/VjjWbz0JeZXCrAb4DNI/KgGYGOtjmnyUbdsY4K1mx+5D+ouA+NHCPnVI/nB0QkPEAxnTdL2/OJ3hWw7wQSyBu/U7qwV2B9Yfp1GZ8Bg= Received: by 10.66.243.1 with SMTP id q1mr666143ugh; Wed, 08 Feb 2006 00:04:01 -0800 (PST) Received: by 10.67.30.2 with HTTP; Wed, 8 Feb 2006 00:04:01 -0800 (PST) Message-ID: <224f32340602080004n3ef26f38wa3872104e368f8a9@mail.gmail.com> Date: Wed, 8 Feb 2006 09:04:01 +0100 From: Thomas Dudziak To: ddlutils-user@db.apache.org Subject: Re: Problem with reading XML. In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 2/8/06, Jun Li wrote: > Just tried ddlutils today. The XML it generates from database looks great= e. > 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 an= d > 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). > Can anyone give me some confidence that ddlutils really works on SQL Serv= er. > 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