Keyword delimiters

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Randy Lane

    Keyword delimiters

    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?
  • mcstock

    #2
    Re: Keyword delimiters

    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):

    SQLcreate table "Randy Lane" ( acolumn number );

    Table created.

    SQLselect * from Randy Lane;
    select * from Randy Lane
    *
    ERROR at line 1:
    ORA-00942: table or view does not exist


    SQLselect * from "randy lane";
    select * from "randy lane"
    *
    ERROR at line 1:
    ORA-00942: table or view does not exist


    SQLselect * 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

    (888) 512-2048

    "Randy Lane" <rmathuln@pacbe ll.netwrote in message
    news:9262ad01.0 310280512.7d65d 0b6@posting.goo gle.com...
    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?

    Comment

    Working...