Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 30th, 2004, 07:50 AM
ikgopolengp ikgopolengp is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: Botswana, Gabz City
Posts: 6 ikgopolengp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to ikgopolengp
Arrow Executing SQL Scripts in new database

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
;

Reply With Quote
  #2  
Old December 4th, 2004, 04:04 PM
beunique beunique is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 50 beunique User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Executing SQL Scripts in new database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT