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: Why Oracle Enforce Name Uniquness ???!!!

Re: Why Oracle Enforce Name Uniquness ???!!!

From: EdStevens <quetico_man_at_yahoo.com>
Date: 3 Nov 2006 10:05:20 -0800
Message-ID: <1162577120.195443.30650@h54g2000cwb.googlegroups.com>

klabu wrote:
> Dang !
>
> why Oracle does not allow a table to have same name as another object type
> ???!!!
>
> SQL> create or replace package woohoo is procedure p_woohoo; end ;
> 2 /
>
> Package created
>
> SQL> create table woohoo as select * from scott.emp;
>
> ORA-00955: name is already used by an existing object
>
>
>
> <10gR2>

Well, one could discuss "why Oracle does not allow..." until the cows come home. The fact is, within a schema, it doesn't allow it. So, we move on and decide how to deal with it. I'd ask why would you even WANT two objects to have the same name? If one takes the common and easy approach of naming tables roughly after the entities they describe (EMPLOYEE, PURCHASE_ORDER, etc) and procedures after what they DO .. (COMPUTE_FICA, FIRE_EMPLOYEE, etc.) there would be no problem. In other words, table names are nouns, procedure names are verbs. Some go even further by adding an object_type_prefix to the object name, especially for procedural code: "TR_" for triggers, "PKG_" for packages, "FN_" for functions, etc.

But then, my roots are in COBOL on IBM mainframes, so I've spent a lot of time on nameing standards that pack as much information about the named object into as concise a format as possible. Received on Fri Nov 03 2006 - 12:05:20 CST

Original text of this message

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