Re: Keyword delimiters
From: mcstock <mcstock_at_enquery.com>
Date: Tue, 28 Oct 2003 09:52:40 -0500
Message-ID: <p6GdnaNFwtdEHwOiRVn-jA_at_comcast.com>
Date: Tue, 28 Oct 2003 09:52:40 -0500
Message-ID: <p6GdnaNFwtdEHwOiRVn-jA_at_comcast.com>
select nameline1 as "Name" from ...
This tells oracle to take the object name as is (object being a table, column, column alias, etc.)
This makes it possible to do stuff like (note that you'd really want to, and it adds no extra security):
SQL> create table "Randy Lane" ( acolumn number );
Table created.
SQL> select * from Randy Lane;
select * from Randy Lane
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> select * from "randy lane";
select * from "randy lane"
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> select * from "Randy Lane";
no rows selected
(by the way, I grew up on Randy Drive in Livonia, Michigan -- I presume there's no relation)
-- ---------------------------------------- Mark C. Stock www.enquery.com (888) 512-2048 "Randy Lane" <rmathuln_at_pacbell.net> wrote in message news:9262ad01.0310280512.7d65d0b6_at_posting.google.com...Received on Tue Oct 28 2003 - 15:52:40 CET
> Are there any characters or symbols that reserved keywords can be
> enclosed with in Oracle (9i) to prevent them from being interpreted as
> control statements or functions?
> MSSQL has this functionality with "[]".
> For example, in MSSQL, this statement returns an error :
>
> SELECT NameLine1 AS Name FROM database1
>
> But this one does not :
>
> SELECT NameLine1 AS [Name] FROM database1
>
> Does Oracle have any way to accomplish this?