Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

create multiple indexes in a procedure

DannyDec 18 2015 — edited Dec 18 2015

Hi,

I am trying to create a single procedure which would create indexes for multiple tables. But when I put multiple create unique index statements, it gives me invalid create statement encountered error. When I try to separate them by ";", it gives me invalid character. Only one create index statement works perfectly. What if I have to create more than 1, one after another?

e.g.

CREATE UNIQUE INDEX schema.XPK_table ON schema.table

(A,B,C,D)

NOLOGGING

TABLESPACE <tblspace name>

PCTFREE    10

INITRANS   2

MAXTRANS   255

STORAGE    (

            INITIAL          128K

            NEXT             1M

            MINEXTENTS       1

            MAXEXTENTS       UNLIMITED

            PCTINCREASE      0

            BUFFER_POOL      DEFAULT

            FLASH_CACHE      DEFAULT

            CELL_FLASH_CACHE DEFAULT

           )

PARALLEL 4;

CREATE UNIQUE INDEX schema.XPK_table ON schema.table

(A,B,C,D,E)

NOLOGGING

TABLESPACE <tblspace name>

PCTFREE    10

INITRANS   2

MAXTRANS   255

STORAGE    (

            INITIAL          128K

            NEXT             1M

            MINEXTENTS       1

            MAXEXTENTS       UNLIMITED

            PCTINCREASE      0

            BUFFER_POOL      DEFAULT

            FLASH_CACHE      DEFAULT

            CELL_FLASH_CACHE DEFAULT

           )

PARALLEL 4  ;

Any ideas how to get this executed? I can have the DBA create a PL/SQL procedure in the DB itself and call it in ODI but they want me to first try in ODI.

Any ideas would be highly appreciated.

Thanks,

Dan

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 15 2016
Added on Dec 18 2015
1 comment
1,018 views