If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Can I specify tablespace first,then create multiple tables without using 'IN' keyword

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-14-03, 04:40
r390gt1 r390gt1 is offline
Registered User
 
Join Date: May 2003
Posts: 27
Question Can I specify tablespace first,then create multiple tables without using 'IN' keyword

Can I specify tablespace first,then create multiple tables without using 'IN' keyword??

more detail.
If I didn't specify 'IN tablespace_name' statement in my create table ddl, all the created tablespace will be resided in a tablespace named 'USERSPACE1' . what I want is to specify a tablespace other than the 'USERSPACE1' before creating tables, and therefore, I don't need to use the 'IN tablespace_name' in every ddl statement for creating table.....

just similar to the way i specify the schema (by command 'set current schema my_schema_name') before I create the tables and all the created tables will under the schema my_schema_name and I don't need to specfiy my_schema_name in every ddl statement for creating table.....

Thanks in advance !! :-)

Regards,
Panco
Reply With Quote
  #2 (permalink)  
Old 10-14-03, 08:37
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Panco,

The answer is no. If you do not specify explicitly which tablespace to create a table in, DB2 uses a complex algorithm (based on USE privaleges) to determine which tablespace it will place the table. And if you have more than one tablespace that will qualify, DB2 will just pick one.

Frankly, if I am creating production tables, I would perfer to make the explicit decision where to place them. That way I can manage them better.

I believe the reason that there is nothing like SET CURRENT SCHEMA for tablespaces, is that table creation is done many orders of magnitude less then queries.

HTH

Andy
Reply With Quote
  #3 (permalink)  
Old 10-15-03, 21:05
r390gt1 r390gt1 is offline
Registered User
 
Join Date: May 2003
Posts: 27
Thanks ARWinner.....

Thanks ARWinner..... :-)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On