Return-Path: Delivered-To: apmail-db-ddlutils-dev-archive@www.apache.org Received: (qmail 11966 invoked from network); 17 Apr 2006 03:06:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Apr 2006 03:06:56 -0000 Received: (qmail 23403 invoked by uid 500); 17 Apr 2006 03:06:56 -0000 Delivered-To: apmail-db-ddlutils-dev-archive@db.apache.org Received: (qmail 23376 invoked by uid 500); 17 Apr 2006 03:06:55 -0000 Mailing-List: contact ddlutils-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ddlutils-dev@db.apache.org Delivered-To: mailing list ddlutils-dev@db.apache.org Received: (qmail 23365 invoked by uid 99); 17 Apr 2006 03:06:55 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Apr 2006 20:06:55 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of jimvester@gmail.com designates 66.249.92.172 as permitted sender) Received: from [66.249.92.172] (HELO uproxy.gmail.com) (66.249.92.172) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Apr 2006 20:06:54 -0700 Received: by uproxy.gmail.com with SMTP id m3so360124ugc for ; Sun, 16 Apr 2006 20:06:33 -0700 (PDT) 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:references; b=PbdytD1vr1Xv4FxiQ48w1OfXp2865zwqQW46OmJv/Un8mJgtRMx6HU4ou01yjn0T8rEZ6Xz1TN3u84YMd7SkU3muwNDaKAMy1GVqjgNDqcU+hjJaqcbfL0MJXkXMNoF8MZhbOOUzdO+OuaGgkn5jEG7CxsIYG26HFLIy4Gy6xZU= Received: by 10.78.29.13 with SMTP id c13mr140503huc; Sun, 16 Apr 2006 20:06:33 -0700 (PDT) Received: by 10.78.21.9 with HTTP; Sun, 16 Apr 2006 20:06:33 -0700 (PDT) Message-ID: <27a7fabc0604162006h5f8290bfx3835729237e05e94@mail.gmail.com> Date: Sun, 16 Apr 2006 23:06:33 -0400 From: "Jim Vester" To: ddlutils-dev@db.apache.org Subject: Re: issue with schema being ignored In-Reply-To: <224f32340604161626v6724129btbc7434665393dd1a@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_26071_29140667.1145243193259" References: <27a7fabc0604122020w4be4a2n70e7477407514ebb@mail.gmail.com> <27a7fabc0604132035o453c205eme92888396a96a338@mail.gmail.com> <224f32340604161626v6724129btbc7434665393dd1a@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_26071_29140667.1145243193259 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I will open the two bugs. When Jira's back up. Adding the schema name to the table name in the xml is an intersting idea, however, depending on the length of the names they could exceed the table name limit for a particular environment. That said it is better than noth'n. On 4/16/06, Thomas Dudziak wrote: > > On 4/14/06, Jim Vester wrote: > > > > > I have a derby Database named myDatabase. > > > The database contains a schema rentabike. > > > the schema contains a table named bikes. > > > > > > when I use the DatabaseToDdlTask to try > > > and unload the schema and data, schema=3D"rentabike" catalog=3D"" > > > userid=3D"user" password=3D"pass", an error occurs. > > > > > > The schema is extracted successfully however the data is not. > > > > > > Here is a snippet of the stack trace: > > > org.apache.ddlutils.DynaSqlException : Error while performing a query > > > at org.apache.ddlutils.platform.PlatformImplBase.query > > > (PlatformImplBase. > > > java:793) > > > at org.apache.ddlutils.task.WriteDataToFileCommand.execute > > > (WriteDataToFi > > > leCommand.java :82) > > > at org.apache.ddlutils.task.DatabaseTaskBase.executeCommands > > > (DatabaseTas > > > kBase.java:198) > > > at org.apache.ddlutils.task.DatabaseTaskBase.execute( > > > DatabaseTaskBase.ja > > > va:222) > > > at org.apache.tools.ant.UnknownElement.execute ( > > > UnknownElement.java:275) > > > at org.apache.tools.ant.Task.perform(Task.java:364) > > > at org.apache.tools.ant.Target.execute(Target.java:341) > > > at org.apache.tools.ant.Target.performTasks(Target.java :369) > > > at org.apache.tools.ant.Project.executeSortedTargets( > Project.java > > > :1216) > > > at org.apache.tools.ant.Project.executeTarget(Project.java > :1185) > > > at org.apache.tools.ant.helper.DefaultExecutor.executeTargets > (DefaultExe > > > cutor.java:40) > > > at org.apache.tools.ant.Project.executeTargets(Project.java > :1068) > > > at org.apache.tools.ant.Main.runBuild(Main.java:668) > > > at org.apache.tools.ant.Main.startAnt(Main.java :187) > > > at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246= ) > > > at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67= ) > > > Caused by: org.apache.derby.client.am.SqlException: Schema 'user' doe= s > not > > > exist > > > at org.apache.derby.client.am.Statement.completeSqlca(Unknown > > > Source) > > > at > org.apache.derby.client.net.NetStatementReply.parsePrepareError > > > (Unkno > > > wn Source) > > > at > > > org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply (Un= k > > > nown Source) > > > at > > > org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutp > > > ut(Unknown Source) > > > at > > > org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput( > > > Unknown Source) > > > at > > > org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(U > > > nknown Source) > > > at > org.apache.derby.client.am.Statement.readPrepareDescribeOutput > > > (Unknow > > > n Source) > > > at org.apache.derby.client.am.Statement.flowExecute (Unknown > > > Source) > > > at org.apache.derby.client.am.Statement.executeQueryX(Unknown > > > Source) > > > at org.apache.derby.client.am.Statement.executeQuery(Unknown > > > Source) > > > at org.apache.commons.dbcp.DelegatingStatement.executeQuery > (DelegatingSt > > > atement.java:205) > > > at org.apache.ddlutils.platform.PlatformImplBase.query > > > (PlatformImplBase. > > > java:787) > > > > > > I think it is occuring because the generated sql from the > > > WritDataToFileCommand.execute > > > > > > does not take into account the schema name. Note userid is added in > front > > > of table names by default. > > > > > > writer.write(platform.query(model, "select * from > "+tables[0].getName(), > > > tables)); > > > > > > The correct sql is select * from schema.table. or select * from > > > rentabike.bikes > > > > > > I had a similar issue with DB2, again with schema, however it failed > > > earlier in > > > determineAutoIncrementFromResultSetMetaData(...) > > > ... > > > query.append (" FROM "); > > > if (getPlatform().isDelimitedIdentifierModeOn()) > > > { > > > query.append(getPlatformInfo().getDelimiterToken()); > > > } > > > query.append(table.getName()); > > > > > > > > > the schema is again missing... I hacked it by checking if a schemaNam= e > > > existed in the table > > > object and appending the table.getSchema() [?] +"." then the table > name. > > > > > > Should a jira bug be opened or is there a simpliler way to provide th= e > > > fully qualifed table name? > > Well, yes, schema support is somewhat lacking yet, you safest bet > currently is to prefix the table names in the XML with the schema > name. But this is obviously not a good solution in the long run. > Please feel free to open two issues (one for the Derby one, and one > for the Db2 one as it is a different spot). > > Tom > ------=_Part_26071_29140667.1145243193259--