Return-Path: Delivered-To: apmail-cayenne-commits-archive@www.apache.org Received: (qmail 60949 invoked from network); 6 Feb 2009 14:00:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Feb 2009 14:00:09 -0000 Received: (qmail 69067 invoked by uid 500); 6 Feb 2009 14:00:09 -0000 Delivered-To: apmail-cayenne-commits-archive@cayenne.apache.org Received: (qmail 69037 invoked by uid 500); 6 Feb 2009 14:00:09 -0000 Mailing-List: contact commits-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list commits@cayenne.apache.org Received: (qmail 69027 invoked by uid 99); 6 Feb 2009 14:00:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Feb 2009 06:00:09 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Feb 2009 14:00:06 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id AA78A234C4AF for ; Fri, 6 Feb 2009 05:59:46 -0800 (PST) Message-ID: <670692624.1233928786696.JavaMail.jira@brutus> Date: Fri, 6 Feb 2009 05:59:46 -0800 (PST) From: "Olga Tkachova (JIRA)" To: commits@cayenne.apache.org Subject: [jira] Updated: (CAY-289) Implement Quoting of identifiers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/cayenne/browse/CAY-289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Olga Tkachova updated CAY-289: ------------------------------ Attachment: postgres.txt > Implement Quoting of identifiers > -------------------------------- > > Key: CAY-289 > URL: https://issues.apache.org/cayenne/browse/CAY-289 > Project: Cayenne > Issue Type: Improvement > Components: Cayenne Core Library > Affects Versions: 3.0M5 > Environment: Linux, Sun JDK1.5, MS SQL Server 2000, jtds-1.0, Croatian locale > Reporter: Tomislav Nakic-Alfirevic > Assignee: Andrus Adamchik > Fix For: 3.0M6 > > Attachments: diffQuoteSqlIdentifiers.txt, InsertUpdateDelete.txt, InsertUpdateDeleteSelect.txt, InsertUpdateDeleteSelect.txt, postgres.txt > > > Say a table "t0" has an attribute "my attrib 0". > You correct the obj-attribute to, for instance, "my_attrib_0", but the db-attribute is still "my attrib 0". > When you try to run a query on "t0", the generated query looks like: > SELECT ..., t0.my attrib 0, ... FROM dbo.t0 AS t0 > This, obviously, can't possibly work. > The correct SQL would be: > SELECT ..., t0.[my attrib 0], ... FROM dbo.[t0] AS t0 > Notice the square brackets arround the attributes and table names: that makes the string a valid attribute or table name valid. > A further improvement might be to add the database name: > SELECT ..., t0.[my attrib 0], ... FROM [dbname].dbo.[t0] AS t0 > I mention it because I use the quantum plugin as a database access plugin and it complained about a table called "dbo.tablename" (as I believe it should) and all was well when I used mydbname.dbo.tablename. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.