Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Space in database table's fields

Re: Space in database table's fields

From: Walt <walt_askier_at_YerBootsyahoo.com>
Date: Wed, 04 May 2005 12:34:17 -0400
Message-ID: <eQ6ee.1226$II.1067@news.itd.umich.edu>


Jim Kennedy wrote:

> <sunny076_at_yahoo.com> wrote 

>>
>>I am wondering how Oracle deals with space in field(attribute) name? I
>>am figuring out the syntax to for example use in SELECT Test Table FROM
>>Test2, for example.
>>
>>I know in SQL we can put [] around the name of the field. Can anyone
>>enlighten me?
> 
> 1. SQL = Structured Query Language.  NOT MicroSoft's SQLServer.
> 2. You can't put [] around the field name in SQL.  It is NOT a standard.
> 3. It is not recommended to put spaces in field or table names.  Bad
> practice.
> 4. If you insist on this then you must double quote the field or table
> names.

Furthermore, once you start messing around with quotes, the text inside the quotes becomes case sensitive. This is a major PITA as far as I'm concerned. Better to avoid the spaces in the first place.

For instance:

SQLWKS> select dummy from dual;
D
-
X
1 row selected.
SQLWKS> select "dummy" from dual;
select "dummy" from dual

        *
ORA-00904: "dummy": invalid identifier
SQLWKS> select "DUMMY" from dual;
D
-
X
1 row selected.

-- 
//-Walt
Received on Wed May 04 2005 - 11:34:17 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US