# Oracle Primary Key Indexes are not Generating

**URL:** <https://forums.toadworld.com/t/oracle-primary-key-indexes-are-not-generating/1859>\
**Category:** Toad Data Modeler\
**Created:** [January 18, 2009, 8:43pm UTC](https://forums.toadworld.com/t/oracle-primary-key-indexes-are-not-generating/1859 "2009-01-18T20:43:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![YewWee](https://avatars.discourse-cdn.com/v4/letter/y/f0a364/32.png) [@YewWee](https://forums.toadworld.com/u/YewWee)\
**Post date:** [January 18, 2009, 8:43pm UTC](https://forums.toadworld.com/t/oracle-primary-key-indexes-are-not-generating/1859/1 "2009-01-18T20:43:43Z")

</div>

Hi,

Please see the generated script (Model | Generate DDL Script).

/\*  
Created: 1/17/2009  
Modified: 1/17/2009  
Model: Purchase Request (Equipment, Supply, IT)  
Database: Oracle 10g  
\*/

– Create tables section -------------------------------------------------

– Table WCC.PR\_PURCHASE\_REQUESTS

CREATE TABLE WCC.PR\_PURCHASE\_REQUESTS(  
PR\_NUMBER Number(9,0) NOT NULL,  
PR\_STATUS\_CODE Varchar2(2 BYTE) NOT NULL,  
DATE\_SUBMITTED Date NOT NULL,  
REQUESTOR\_FL\_NAME Varchar2(64 BYTE) NOT NULL,  
BILLING\_CATEGORY Varchar2(20 BYTE) NOT NULL,  
SECTION\_MGR\_FL\_NAME Varchar2(30 BYTE) NOT NULL,  
ORDER\_STATUS Varchar2(15 BYTE) NOT NULL,  
ORG\_SOURCE Varchar2(20 BYTE) NOT NULL,  
ORG\_DATE Date NOT NULL,  
CHG\_SOURCE Varchar2(30 BYTE),  
CHG\_DATE Date,  
REQUESTOR\_USER\_ID Varchar2(20 BYTE) NOT NULL,  
SECTION\_MGR\_USER\_ID Varchar2(20 BYTE) NOT NULL  
)  
TABLESPACE WCPD\_DATA\_TS  
;

– Add keys for table WCC.PR\_PURCHASE\_REQUESTS

ALTER TABLE WCC.PR\_PURCHASE\_REQUESTS ADD CONSTRAINT PR\_PURCHASE\_REQUEST\_PK PRIMARY KEY (PR\_NUMBER)  
USING INDEX PR\_PURCHASE\_REQUEST\_PK\_I  
;

– Create relationships section -------------------------------------------------

CREATE INDEX PRSTTSRQRD\_I ON WCC.PR\_PURCHASE\_REQUESTS (PR\_STATUS\_CODE)  
TABLESPACE WCPD\_INDEX\_TS  
;  
ALTER TABLE WCC.PR\_PURCHASE\_REQUESTS ADD CONSTRAINT PRSTTSRQRD\_FK FOREIGN KEY (PR\_STATUS\_CODE) REFERENCES WCC.PR\_STATUS\_CODES (PR\_STATUS\_CODE)  
;

The Oracle Primary Key Indexes are no longer generating in front of the Alter Table Add Constraint Primary Key The Name of the Using Index is filled in and so is the Tablespace.

Is this because the index is automatically created by the database when the constraint is enabled and that is why the script do not contain it?

Regards,  
Yew Wee

---

<div class="post-metadata">

**Author:** ![vladka](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/vladka/32/41_2.png) [@vladka](https://forums.toadworld.com/u/vladka)\
**Post date:** [January 19, 2009, 4:24am UTC](https://forums.toadworld.com/t/oracle-primary-key-indexes-are-not-generating/1859/2 "2009-01-19T04:24:49Z")

</div>

Hello Yew,

We suppose the DDL you sent us is a DDL from model created during RE.  
We need the original DDL (DDL executed in database before you did RE).

Thanks for it in advance.

Regards,

Vladka + TDM Team

---

<div class="post-metadata">

**Author:** ![YewWee](https://avatars.discourse-cdn.com/v4/letter/y/f0a364/32.png) [@YewWee](https://forums.toadworld.com/u/YewWee)\
**Post date:** [January 20, 2009, 7:45pm UTC](https://forums.toadworld.com/t/oracle-primary-key-indexes-are-not-generating/1859/3 "2009-01-20T19:45:12Z")

</div>

It is resolved now.

Create all Keys was not selected under the Extended Value
