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

Home -> Community -> Usenet -> c.d.o.server -> Re: The Oracle Inconsistencies List -- please add to it!

Re: The Oracle Inconsistencies List -- please add to it!

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 13 Aug 1998 13:11:19 GMT
Message-ID: <35dde4bb.87471036@192.86.155.100>


A copy of this was sent to johnvue_at_gte.net (if that email address didn't require changing) On Thu, 13 Aug 1998 11:48:31 GMT, you wrote:

>On Wed, 12 Aug 1998 03:27:51 GMT, johnvue_at_gte.net wrote:
>>Why do your fingers want to type "select name from v$logfile" or
>>"create tabespace data1 default storage (pct_increase 0)" even though
>>they don't work? Because Oracle makes it harder than it has to be.
>
>>Actually, pctincrease is a reserved word so it couldn't be used as
>acolumn name.
>
>Not quite true. Take a look at the examples below.
>
> Oracle7 Server Release 7.3.3.4.0 - Production Release
> With the distributed and parallel query options
> PL/SQL Release 2.3.3.4.0 - Production
>
> SQL> create table z1 (pctincrease number(9));
>
> Table created.
>
>As you can see PCTINCREASE is a reserved word but Oracle allows it to
>be used as a column name. Now there DEFINITELY are reserved words
>that can't be used as column names unless you surround them with
>quotes. The following examples illustrate this point:
>
> SQL> create table z1(CREATE number(9));
> create table z1(CREATE number(9))
> *
> ERROR at line 1:
> ORA-00904: invalid column name
>
>
> SQL> create table z1("CREATE" number(9));
>
> Table created.
>
>See what you get for not testing your own advice??? Oracle makes you
>pay :). As a matter of fact, you've just added another
>"inconsistency" to the list! Oracle requires some reserved words with
>quotes and allows others without quotes. Thanks!

No not really -- Oracle does not require some reserved words with quotes and others without -- no reserved word is allowed as a name without quotes but keywords are allowed as names without quoting them. PCTINCREASE is a KEYWORD -- CREATE is a RESERVED WORD.

The sql language reference manual on page 2-4 (v7) or 2-6 (v8) lists all RESERVED WORDS (a RESERVED WORD cannot be used as a 'name' but a KEYWORD can be). So, pctfree is a reserved word while pctincrease is a keyword:

SQL> create table testing ( pctfree int ); create table testing ( pctfree int )

                       *

ERROR at line 1:
ORA-00904: invalid column name

SQL> create table testing ( pctincrease int ); Table created.  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

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 Thu Aug 13 1998 - 08:11:19 CDT

Original text of this message

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