Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Can Oracle Support Double Quotes?
A copy of this was sent to "Rob Kraft" <robkraft_at_email.msn.com>
(if that email address didn't require changing)
On Mon, 23 Nov 1998 21:56:54 -0600, you wrote:
>I have an application written using double-quotes to deliminate strings. It
>works on SQL Server, Sybase, and Access. We want to port it to Oracle but
>can't figure out how to get Oracle to accept double quotes as the string
>delimiter. Is there an environmental parameter we can change?
>
>An example of a query we are trying to run is
>Select * from customers where Lastname = "Ellison"
>
>I know that we can make it work by replacing the double-quotes with single
>quotes, but that requires analyzing thousands of lines of code to make the
>changes. I'm looking for an easier way. Can Oracle do this?
>
No, unfortunately those "sql-92" databases allow you do code things that are 100% opposite from the standard.
Double Quotes in SQL have a purpose -- they are for support of Quoted Identifiers. According to the standard, ... where Lastname = "Ellison" reads:
compare the column named LASTNAME to the column named Ellision
In SQL, all identifiers are rolled to uppercase -- unless quoted, in which case the case is preserved and special characters may be used. You can for example:
SQL> create table "%" ( "^" int, "*" int, "@" int, " " int, " " int );
Table created.
SQL> desc "%"
Name Null? Type ------------------------------- -------- ---- ^ NUMBER(38) * NUMBER(38) @ NUMBER(38) NUMBER(38)
All 100% legal AS LONG as they are quoted...
So, since double quotes have a real meaning (at least they are supposed too starting with sql-89 on up) -- we cannot use them as literal string delimiters...
>Rob Kraft
>robkraft_at_msn.com
>
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA
--
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Tue Nov 24 1998 - 09:32:22 CST
![]() |
![]() |