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: Column Questions

Re: Column Questions

From: Howard J. Rogers <howardjr_at_www.com>
Date: Mon, 28 May 2001 22:36:19 +1000
Message-ID: <3b12465d$1@news.iprimus.com.au>

"Dr. Mueller" <nospam_at_nospam.com> wrote in message news:oqdQ6.2710$kh4.236464_at_bgtnsc04-news.ops.worldnet.att.net...
> Hello,
>
> I'm seeking advice from experts on a few questions:
>
> 1) Is there a naming convention for indexes and triggers? I've seen a few
> examples for indexes, people use K_ and PK_. Just wondered what you
 thought
>

Yes (for indexes anyway), the one recommended at Oracle is to use <table_name>_<column_name>_<idx>

Hence an Index on EMP's department columns would become emp_deptno_idx.

Variations I've used include sticking a 'uidx', or a 'ridx' at the end for uniques and reversed indexes.

Many indexes are named the same as the constraints that cause them to be created. Again, the 'standard' convention offered by Oracle's training materials (and happily used by me in the real world) is: <table_name>_<column_name>_<constraint_type>. Hence, EMP's primary key constraint (and thus it's index) is named emp_empno_pk.

Trouble starts, though, with concatenated constraints and indexes, since an object name can only be around 30 characters long, so if you are (as I once was) indexing 6 columns named 'Areacode', 'Sitecode','Featurecode','Plotnum',Gangcode' and 'Costcode'), you're in for an interesting time. Your best bet, I reckon, at that point is to produce something which is recognisable and meaningful, if not completely descriptive. I ended up with the previous lot called 'features_worklink_pk', and sitelink was all I needed to make sense of it all.

Regards
HJR
> 2) I want to create a DESCRIPTION column, which is a VARCHAR2(256). The
> problem is I want to search it at some point, is it considered an "OK"
 thing
> to create a non-unique index from this?
>
> That's all.
>
> Thank you.
>
>
Received on Mon May 28 2001 - 07:36:19 CDT

Original text of this message

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