From open-jpa-dev-return-1956-apmail-incubator-open-jpa-dev-archive=incubator.apache.org@incubator.apache.org Tue Feb 06 02:57:28 2007 Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 80987 invoked from network); 6 Feb 2007 02:57:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Feb 2007 02:57:27 -0000 Received: (qmail 48548 invoked by uid 500); 6 Feb 2007 02:57:33 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 48326 invoked by uid 500); 6 Feb 2007 02:57:33 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 48310 invoked by uid 99); 6 Feb 2007 02:57:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Feb 2007 18:57:33 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Feb 2007 18:57:25 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B86477142D4 for ; Mon, 5 Feb 2007 18:57:05 -0800 (PST) Message-ID: <22983419.1170730625753.JavaMail.jira@brutus> Date: Mon, 5 Feb 2007 18:57:05 -0800 (PST) From: "Patrick Linskey (JIRA)" To: open-jpa-dev@incubator.apache.org Subject: [jira] Commented: (OPENJPA-84) Escape sql reserved words in column names In-Reply-To: <12178909.1163747557024.JavaMail.jira@brutus> 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/jira/browse/OPENJPA-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470432 ] Patrick Linskey commented on OPENJPA-84: ---------------------------------------- Changing to major because I think that getting rid of the trailing 0 would be very very nice. Backwards-compatibility for people upgrading will need some consideration, though. > Escape sql reserved words in column names > ----------------------------------------- > > Key: OPENJPA-84 > URL: https://issues.apache.org/jira/browse/OPENJPA-84 > Project: OpenJPA > Issue Type: Improvement > Components: sql > Reporter: Roger Keays > > OpenJPA does not escape reserved words in SQL queries when they are used as column names. To escape a reserved name you just put it in quotes: > INSERT INTO FB_PRIVILEGES (comment, inheritable, level, role, type, username, item_uuid) ... > on oracle, becomes > INSERT INTO FB_PRIVILEGES ("comment", inheritable, "level", role, "type", username, item_uuid) ... > Looking at the code in DBDictionary, it appears that the escaping is done for table and sequence names by appending a numeral to the name. There isn't really any good reason to do this instead of quoting the identifier. > table.name identifiers would have to be escaped as "table"."name" if both table and name were reserved words. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.