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 Column Name Problem

Re: Reserved Column Name Problem

From: Anurag <avdbi_at_hotmail.com>
Date: Tue, 13 Aug 2002 22:28:19 -0400
Message-ID: <uljg25i8dv58a5@corp.supernews.com>


Oracle 9i on XP:

SQL> create table y ("Comment" varchar2(10));

Table created.

SQL> insert into y ("Comment") values ('abc');

1 row created.

SQL> update y set "Comment" = 'xyz';

1 row updated.

SQL> select * from y;

Comment



xyz

???

Anurag
<abc_at_iom.com> wrote in message news:3d59ae3f.26938535_at_news.sf.sbcglobal.net...
> This is a tired subject, I know. I know that I'm not supposed to use
> reserved words, etc., etc, etc. But I'm porting an app over and don't
> have time to change all my column names.
>
> So here's my question:
>
> In 9i,
> Oracle says that you use reserved words as column names but you have
> to surround them in double-quotes (e.g. "Comment")
>
> And all this works just ducky. In select statements, in insert
> statements, etc.
>
> However, it does not work with UPDATE statements.
>
> I have a table named Addresses. I have a field named "Comment" (with
> double quotes).
>
> This works:
> SELECT name,address,"Comment" from addresses
>
> This works:
> INSERT INTO Addresses (Name,Address,"Comment") VALUES ('Bob','101 main
> street','This is a comment')
>
> THIS DOES NOT WORK:
> Update Addresses SET "Comment" = 'This is a Comment'
>
> Any ideas around this problem?
>
Received on Tue Aug 13 2002 - 21:28:19 CDT

Original text of this message

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