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: A column named "NUMBER"

Re: A column named "NUMBER"

From: guenter-huerkamp <guenter-huerkamp_at_web.de>
Date: Mon, 11 Oct 2004 20:09:11 +0200
Message-ID: <2t00f7F1qkbjuU1@uni-berlin.de>


D. Alvarado wrote:
> Hi, I'm running Oracle 8.1.7 for Solaris. I'm not sure how this
> condition came about in my environment, but a table was created and it
> contains a column named "NUMBER". That is not the data type, that is
> the actual column name (The data type is VARCHAR2(4)).
>
> So, when I try to update this column, like so
>
> UPDATE SCHOOLS SET NUMBER = '1234' WHERE PID = '00000024'
>
> I get the error
>
> ERROR at line 1:
> ORA-01747: invalid user.table.column, table.column, or column
> specification
>
> What can I do to properly update this column? IOf course, I will make
> every effort to track down the person that created this table and
> harass them.
>
> Thanks, - Dave

Very bad coding , but you can do this:

SCOTT at gh1 >create table test (number varchar2(4)); create table test (number varchar2(4))

                    *

ERROR at line 1:
ORA-00904: Ungültiger Spaltenname

SCOTT at gh1 >create table test ("number" varchar2(4));

Table created.

SCOTT at gh1 >desc test

  Name                                      Null?    Type
  ----------------------------------------- -------- 
----------------------------
  number                                             VARCHAR2(4)

SCOTT at gh1 >update test set number = 123; update test set number = 123

                 *

ERROR at line 1:
ORA-01747: Ungültige Angabe von Benutzer.Tabelle.Spalte, Tabelle.Spalte oder Spalte

SCOTT at gh1 >update test set "number" = 123;

0 rows updated.

SCOTT at gh1 >

Look at the " around the column number.

hth
Günter Received on Mon Oct 11 2004 - 13:09:11 CDT

Original text of this message

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