|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I copied the generated an sql script from another db and want to use it to create tables in another one using PL/SQL Developer, how do i go about, making sure the tables are created in a specific index tablespace.
Potion of code: DROP TABLE ALLOCATIONS CASCADE CONSTRAINTS ; CREATE TABLE ALLOCATIONS ( JUNIOR_CENTRE_NO VARCHAR2 (15) NOT NULL, SELECTION_YEAR NUMBER (4) NOT NULL, CANDIDATE_ID VARCHAR2 (5) NOT NULL, ALLOCATED_SCHOOL VARCHAR2 (15) NOT NULL, ALLOCATION_TYPE CHAR (2) NOT NULL, PLACE_TAKENUP_YN CHAR (1) NOT NULL, TRANSFERED_YN CHAR (1), CONSTRAINT ALLOC_PK PRIMARY KEY ( JUNIOR_CENTRE_NO, SELECTION_YEAR, CANDIDATE_ID ) ) ; ALTER TABLE ALLOCATIONS ADD CONSTRAINT ALLO_ALLOCATION_CK CHECK (Allocation_Type IN ('CC','CH','CA', 'RA', 'RE', 'TR') ) ; ALTER TABLE ALLOCATIONS ADD CONSTRAINT ALLO_PLACE_TAKENUP_YN_CK CHECK ( Place_TakenUp_YN IN ('Y', 'N') ) ; ALTER TABLE ALLOCATIONS ADD CONSTRAINT ALLO_TRANSFERED_YN_CK CHECK (Transfered_YN IN ('Y', 'N') ) ; CREATE INDEX EISD.ALLOC_ALLOCATED_SCHOOL_I ON "EISD".ALLOCATIONS(ALLOCATED_SCHOOL) TABLESPACE EIS_INDEX ; |
|
#2
|
|||
|
|||
|
If you need to create this table in a specific tablespace you need to specify the tablespace with the create table clause (I don't know how to change it onces its been created).
Craete table test (col_1 varchar2(1) tablespace my_tbsp; try that as an example. |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Executing SQL Scripts in new database |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|