©Mike Moxcey 2002  Oracle Designer

Column and Attribute Sequence Order in Oracle Designer

(and using reserved words for attributes)

The display sequence of columns in forms and attributes in entities is set differently than it is for columns in actual tables.

Here is the property palette of an entity (in the E/R Diagrammer)
The second column is a Sequence sort that affects how the attributes appear on a diagram and how they will appear in a generated form.


 

Here, Iíve got the columns sequenced 10-90 in the order I want them to appear.

I used a bunch of reserved words as attribute names to show that when they are generated, some get prefixed with the shortname.


Here is the property palette of the table definition in Design Editor (after running the DDT).

The columns displayed are in the sequence order I set in the Entity definition.

 


However, when I generate the DDL to create tables, the column order will be determined by the sequence_in_table property of each column.
This also determines the order they show up in the relational table definition.
Here is the Design Editor (server model tab).
The left side shows the columns in the relational table definition.
The right side shows the property palette for the TYPE (now named resrc_type) column.
There is a Sequence in table property set to "2".


Now I have reordered the columns with the two IDs as 1 and 2 and all the rest with the original 10-90 sequencing used in the entity.

The columns on the left have been reordered and the property palette on the right is now for the foreign_key..

 


Generating the DDL gives me the fields in the order I want.

Here is the table creation script:
 

PROMPT Creating Table 'RESRCITM'

CREATE TABLE RESRCITM
(RESRCITM_ID NUMBER(10,0) NOT NULL
,TYP VARCHAR2(10) NOT NULL
,TRACK_CODE VARCHAR2(10)
,NAME VARCHAR2(80) NOT NULL
,NOTES VARCHAR2(2000)
,ABBREVIATION VARCHAR2(20) NOT NULL
)
/
 

PROMPT Creating Table 'RESRC'

CREATE TABLE RESRC
(RESRC_ID NUMBER(10,0) NOT NULL
,RESRCITM_RESRCITM_ID NUMBER(10,0) NOT NULL
,ABBREV VARCHAR2(20) NOT NULL
,RESRC_TYPE VARCHAR2(10) NOT NULL
,NAME VARCHAR2(80)
,RESRC_RESOURCE VARCHAR2(20)
,DATA_TYPE VARCHAR2(10)
,STRING VARCHAR2(2000)
,RESRC_TABLE VARCHAR2(2000)
,RESRC_VIEW VARCHAR2(2000)
,RESRC_SET VARCHAR2(2000)
)
/