Is this a bug?

This is a discussion on Is this a bug? within the Database Discussions forums in Database and Unix Discussions category; Anurag Varma schrieb: > The bug (or inconsistency as you might want to call it) is that oracle > should > not allow a column name and datatype to be of the same name IF the > column > name is not enclosed in double quotes. > > So create table test (timestamp timestamp); should throw an error > since all other datatypes do throw an error. > You are far too optimistic ;-) scott@ORA102> create table t(id number,bfile bfile); Table created. scott@ORA102> drop table t; Table dropped. scott@ORA102> create table t(id number,clob clob); Table created. scott-at-ORA102> drop table t; Table dropped. ...

Go Back   Database Forum > Database and Unix Discussions > Database Discussions

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #21  
Old 01-04-2007, 12:09 PM
Default Re: Is this a bug?

Anurag Varma schrieb:

> The bug (or inconsistency as you might want to call it) is that oracle
> should
> not allow a column name and datatype to be of the same name IF the
> column
> name is not enclosed in double quotes.
>
> So create table test (timestamp timestamp); should throw an error
> since all other datatypes do throw an error.
>


You are far too optimistic ;-)

scott-at-ORA102> create table t(id number,bfile bfile);

Table created.

scott-at-ORA102> drop table t;

Table dropped.

scott-at-ORA102> create table t(id number,clob clob);

Table created.

scott-at-ORA102> drop table t;

Table dropped.

scott-at-ORA102> create table t(id number,blob blob);

Table created.

scott-at-ORA102> drop table t;

Table dropped.

scott-at-ORA102> create table t(id number,nchar nchar);

Table created.

scott-at-ORA102> drop table t;

Table dropped.


In all the cases behaviour with plsql units referencing the table is
identical to those with timestamp...

Best regards

Maxim
Reply With Quote
  #22  
Old 01-04-2007, 12:24 PM
Default Re: Is this a bug?

.... or go even further and run:

SELECT DISTINCT owner, column_name, data_type
FROM dba_tab_columns
WHERE column_name IN (SELECT keyword
FROM v$reserved_words) AND owner LIKE
'SYS%';

Reply With Quote
  #23  
Old 01-04-2007, 12:24 PM
Default Re: Is this a bug?

.... or go even further and run:

SELECT DISTINCT owner, column_name, data_type
FROM dba_tab_columns
WHERE column_name IN (SELECT keyword
FROM v$reserved_words) AND owner LIKE
'SYS%';

Reply With Quote
  #24  
Old 01-04-2007, 12:32 PM
Default Re: Is this a bug?


Maxim Demenko wrote:
> Anurag Varma schrieb:
>
> > The bug (or inconsistency as you might want to call it) is that oracle
> > should
> > not allow a column name and datatype to be of the same name IF the
> > column
> > name is not enclosed in double quotes.
> >
> > So create table test (timestamp timestamp); should throw an error
> > since all other datatypes do throw an error.
> >

>
> You are far too optimistic ;-)
>
> scott-at-ORA102> create table t(id number,bfile bfile);
>
> Table created.
>
> scott-at-ORA102> drop table t;
>
> Table dropped.
>
> scott-at-ORA102> create table t(id number,clob clob);
>
> Table created.
>
> scott-at-ORA102> drop table t;
>
> Table dropped.
>
> scott-at-ORA102> create table t(id number,blob blob);
>
> Table created.
>
> scott-at-ORA102> drop table t;
>
> Table dropped.
>
> scott-at-ORA102> create table t(id number,nchar nchar);
>
> Table created.
>
> scott-at-ORA102> drop table t;
>
> Table dropped.
>
>
> In all the cases behaviour with plsql units referencing the table is
> identical to those with timestamp...
>
> Best regards
>
> Maxim



Thanks for the correction.



Anurag

Reply With Quote
  #25  
Old 01-04-2007, 12:32 PM
Default Re: Is this a bug?


Maxim Demenko wrote:
> Anurag Varma schrieb:
>
> > The bug (or inconsistency as you might want to call it) is that oracle
> > should
> > not allow a column name and datatype to be of the same name IF the
> > column
> > name is not enclosed in double quotes.
> >
> > So create table test (timestamp timestamp); should throw an error
> > since all other datatypes do throw an error.
> >

>
> You are far too optimistic ;-)
>
> scott-at-ORA102> create table t(id number,bfile bfile);
>
> Table created.
>
> scott-at-ORA102> drop table t;
>
> Table dropped.
>
> scott-at-ORA102> create table t(id number,clob clob);
>
> Table created.
>
> scott-at-ORA102> drop table t;
>
> Table dropped.
>
> scott-at-ORA102> create table t(id number,blob blob);
>
> Table created.
>
> scott-at-ORA102> drop table t;
>
> Table dropped.
>
> scott-at-ORA102> create table t(id number,nchar nchar);
>
> Table created.
>
> scott-at-ORA102> drop table t;
>
> Table dropped.
>
>
> In all the cases behaviour with plsql units referencing the table is
> identical to those with timestamp...
>
> Best regards
>
> Maxim



Thanks for the correction.



Anurag

Reply With Quote
  #26  
Old 01-04-2007, 12:44 PM
Default Re: Is this a bug?

Valentin Minzatu wrote:
> ... or go even further and run:
>
> SELECT DISTINCT owner, column_name, data_type
> FROM dba_tab_columns
> WHERE column_name IN (SELECT keyword
> FROM v$reserved_words) AND owner LIKE
> 'SYS%';
>


To me, this explains why you can create columns with certain reserved
words. If Oracle precluded you from doing so, then the Data Dictionary
would break.

Cheers,
Brian


--
================================================== =================

Brian Peasland
dba-at-nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Reply With Quote
  #27  
Old 01-04-2007, 12:44 PM
Default Re: Is this a bug?

Valentin Minzatu wrote:
> ... or go even further and run:
>
> SELECT DISTINCT owner, column_name, data_type
> FROM dba_tab_columns
> WHERE column_name IN (SELECT keyword
> FROM v$reserved_words) AND owner LIKE
> 'SYS%';
>


To me, this explains why you can create columns with certain reserved
words. If Oracle precluded you from doing so, then the Data Dictionary
would break.

Cheers,
Brian


--
================================================== =================

Brian Peasland
dba-at-nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Reply With Quote
  #28  
Old 01-04-2007, 12:47 PM
Default Re: Is this a bug?

Serge Rielau wrote:

>> I'm not quite sure I can agree that something violating Oracle's advice,
>> and generating an error, is a bug. At least not as long as the word
>> TIMESTAMP is present in gv$reserved_words.

> I wish my customers were as tolerant as you are....


When a company goes to the effort to put a reference of keywords into
their product then it becomes the obligation of the developers and DBAs
to use it.

When you buy an car ... do you expect the dealer to teach you how to
drive it?
--
Daniel A. Morgan
University of Washington
damorgan-at-x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Reply With Quote
  #29  
Old 01-04-2007, 12:47 PM
Default Re: Is this a bug?

Serge Rielau wrote:

>> I'm not quite sure I can agree that something violating Oracle's advice,
>> and generating an error, is a bug. At least not as long as the word
>> TIMESTAMP is present in gv$reserved_words.

> I wish my customers were as tolerant as you are....


When a company goes to the effort to put a reference of keywords into
their product then it becomes the obligation of the developers and DBAs
to use it.

When you buy an car ... do you expect the dealer to teach you how to
drive it?
--
Daniel A. Morgan
University of Washington
damorgan-at-x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Reply With Quote
  #30  
Old 01-04-2007, 12:52 PM
Default Re: Is this a bug?

Anurag Varma wrote:
> DA Morgan wrote:
>> EscVector wrote:
>>> Anurag Varma wrote:

> -snip-
>>>> You are right .. it should be a bug. However, probably not easy
>>>> to fix ...
>>>>
>>>> You might want to read Bug 4703738 where this is discussed.
>>>>
>>>> Anurag
>>> Quote from doc:
>>> This issue is fixed in
>>> * 9.2.0.8 (Server Patch Set)
>>>
>>> Well they didn't kill this bug. It is back again in 10.2.0.2

>> I'm not quite sure I can agree that something violating Oracle's advice,
>> and generating an error, is a bug. At least not as long as the word
>> TIMESTAMP is present in gv$reserved_words.
>> --
>> Daniel A. Morgan

>
> The bug (or inconsistency as you might want to call it) is that oracle
> should
> not allow a column name and datatype to be of the same name IF the
> column
> name is not enclosed in double quotes.
>
> So create table test (timestamp timestamp); should throw an error
> since all other datatypes do throw an error.


I would agree that throwing an error would be a "nice to have" but I
wouldn't call it a bug any more than I would expect Oracle to hold my
hand if I am fool enough to write this code.

CREATE SYNONYM dummy FOR dual;

set serveroutput on

DECLARE
dummy VARCHAR2(1);
BEGIN
SELECT dummy
INTO dummy
FROM dummy;

dbms_output.put_line(dummy);
END;
/
--
Daniel A. Morgan
University of Washington
damorgan-at-x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 06:07 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.