Path: news.cambrium.nl!textnews.cambrium.nl!feeder2.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.246.MISMATCH!nx02.iad01.newshosting.com!newshosting.com!69.16.185.21.MISMATCH!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!6g2000prh.googlegroups.com!not-for-mail
From: Mark D Powell <Mark.Powell2@hp.com>
Newsgroups: comp.databases.oracle.misc
Subject: Re: Single quote as first character in string fails in compare
Date: Mon, 10 Oct 2011 11:57:26 -0700 (PDT)
Organization: http://groups.google.com
Lines: 55
Message-ID: <1b71757b-392b-4d5e-ae12-23135c8dbaa1@6g2000prh.googlegroups.com>
References: <orgu87htc7mlo50errprb9qpagslqlaeub@4ax.com> <j6ucbl$a3i$1@dont-email.me>
NNTP-Posting-Host: 15.219.153.75
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1318273046 7182 127.0.0.1 (10 Oct 2011 18:57:26 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 10 Oct 2011 18:57:26 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 6g2000prh.googlegroups.com; posting-host=15.219.153.75; posting-account=qJFqbQkAAACYQSLN0-cvP6ydkRfuOu6u
User-Agent: G2/1.0
X-Google-Web-Client: true
X-Google-Header-Order: ARLEUHCNK
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
 Hewlett-Packard; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727;
 .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8),gzip(gfe)
Xref:  news.cambrium.nl

On Oct 10, 5:02=A0am, "=C1lvaro G. Vicario"
<alvaro.NOSPAMTH...@demogracia.com.invalid> wrote:
> El 07/10/2011 20:30, Joachim Verhagen escribi /wrote:
>
> > I got a very strange problem. =A0 If the first character in a string is
> > a single quote I get a syntax error, =A0but that only happens in a
> > compare and not in sqlplus.
>
> > This is what happens:
>
> > SELECT * FROM dual WHERE dummy =3D'''aaaa'
>
> > DBArecordSet.OpenSet: Error from: 'OraOLEDB' 0x80040E14 (-2147217900)
> > ORA-00933: SQL command not properly ended Native: 933 =A0(help=3D.0)
>
> > This goes =A0wrong with an OLEDB and ODBC connection. =A0It works in
> > sqlplus.
>
> I don't know what your client language is but here's an excerpt from the
> ODBC chapter in the PHP manual:
>
> Parameters in parameter_array will be substituted for placeholders in
> the prepared statement in order. Elements of this array will be
> converted to strings by calling this function.
>
> Any parameters in parameter_array which start and end with single quotes
> will be taken as the name of a file to read and send to the database
> server as the data for the appropriate placeholder.
> If you wish to store a string which actually begins and ends with single
> quotes, you must add a space or other non-single-quote character to the
> beginning or end of the parameter, which will prevent the parameter from
> being taken as a file name. If this is not an option, then you must use
> another mechanism to store the string, such as executing the query
> directly with odbc_exec()).
>
> http://es.php.net/manual/en/function.odbc-execute.php
>
> It isn't exactly your case (your string does not end with single quote)
> but this suggests that the ODBC implementation has a weird relationship
> with single quotes.
>
> --
> --http://alvaro.es- lvaro G. Vicario - Burgos, Spain
> -- Mi sitio sobre programaci n web:http://borrame.com
> -- Mi web de humor satinado:http://www.demogracia.com
> --

I find this to be an interesting piece of information.  As is the fact
a name can start with a sinle quote.  In English names about the only
time you run into single quotes in names is with O'reilly, O'connor,
etc ... and it is not a starting or ending.  Naturally I have seen
quoted strings being stored but apparently the access is not via ODBC.

HTH -- Mark D Powell --

