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: Reserved SQL word used as column name in a V$ table!

Re: Reserved SQL word used as column name in a V$ table!

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1997/06/13
Message-ID: <33a0fd1b.2640957@newshost>#1/1

On Tue, 10 Jun 1997 18:54:57 GMT, ben_ryan_at_vancity.com (Ben Ryan) wrote:

[snip]

>describe v$db_pipes
> Name Null? Type
> ------------------------------- -------- ----
> OWNERID NUMBER
> NAME VARCHAR2(1000)
> TYPE VARCHAR2(7)
> SIZE NUMBER
>
>SELECT v$db_pipes.size FROM v$db_pipes;
>ERROR at line 1:
>ORA-01747: invalid user.table.column, table.column, or column
>specification
> *

select "SIZE" from v$db_pipes

will do it. You can always use " (double quotes) to access Identifiers that have mixed case, special characters or are keywords. For example:

SQL> create table foo (
  2 " " int,
  3 " hi !" int );  

Table created.  

SQL>
SQL> desc foo

 Name                            Null?    Type
 ------------------------------- -------- ----
                                          NUMBER(38)
  hi !                                    NUMBER(38)
 

SQL>
SQL> insert into foo values ( 5, 5 );  

1 row created.  

SQL>
SQL> select " " from foo;    


         5  

SQL> select " hi !" from foo;  

      hi !


         5  

[snip]

>Ben Ryan - VanCity C.U.
>Vancouver, B.C.
>Canada
>

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD

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



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri Jun 13 1997 - 00:00:00 CDT

Original text of this message

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