Return-Path: X-Original-To: apmail-db-derby-user-archive@www.apache.org Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 473CF11509 for ; Sun, 20 Apr 2014 15:38:41 +0000 (UTC) Received: (qmail 86733 invoked by uid 500); 20 Apr 2014 15:38:40 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 86672 invoked by uid 500); 20 Apr 2014 15:38:40 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 86665 invoked by uid 99); 20 Apr 2014 15:38:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Apr 2014 15:38:40 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rick.hillegas@oracle.com designates 156.151.31.81 as permitted sender) Received: from [156.151.31.81] (HELO userp1040.oracle.com) (156.151.31.81) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Apr 2014 15:38:32 +0000 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s3KFcBTF006563 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 20 Apr 2014 15:38:11 GMT Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s3KFcBPW020273 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 20 Apr 2014 15:38:11 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userz7022.oracle.com (8.14.5+Sun/8.14.4) with ESMTP id s3KFcA4Q020266 for ; Sun, 20 Apr 2014 15:38:10 GMT Received: from dhcp-whq-twvpn-1-vpnpool-10-159-159-35.vpn.oracle.com (/10.159.159.35) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 20 Apr 2014 08:38:10 -0700 Message-ID: <5353E9E2.4030207@oracle.com> Date: Sun, 20 Apr 2014 08:38:10 -0700 From: Rick Hillegas User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.7; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: derby-user@db.apache.org Subject: Re: CREATE TABLE lexical error References: <002101cf5b6f$904bd4e0$b0e37ea0$@gmail.com> <53528DE4.5010705@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-Virus-Checked: Checked by ClamAV on apache.org On 4/19/14 8:18 AM, Patrick Meyer wrote: > > Thanks John. Yes, I was cutting and pasting from Notepad, but I was > doing that for all four lines. I don't understand why it worked for > some lines but not others. > > Nevertheless, the cutting and pasting is not my real problem. I > created these four statements to reproduce a problem I encountered > with my program. I get the same lexical error when my program obtains > the column names from a delimited text file. This error only occurs > with some (actually, very few) files and I cannot figure out why. Any > ideas why? > Not your immediate problem, but it sounds as though you may have a SQL injection issue if you are creating tables with user-supplied column names. Make sure that you correctly quote and escape the user-supplied column names. Hope this helps, -Rick > > Thanks > > On Apr 19, 2014 10:53 AM, "John English" > wrote: > > On 19/04/2014 04:34, Patrick Meyer wrote: > > I have an application that allows users to import data into > Derby. As such, the > users specify the column names. A user encountered a lexical > error message that > I have been able to reproduce with the following CREATE TABLE > statements. Can > anyone explain why the column names appear to be causing a > lexical error and how > to avoid it? I am using 10.9.1. > > > \uFEFF is a Unicode "zero-width line break" character. Presumably > you're cutting and pasting from somewhere; try pasting into a > plain-text editor and then cut & paste from there to get rid of it? > > HTH, > -- > John English >