views:

22

answers:

1

I am creating a table with tablespace:

CREATE TABLE SALARY.....
     IN ACCOUNTING INDEX IN ACCOUNT_IDX 

Where will the Accounting and Account_IDX be created?

+2  A: 

The script that you have above will create SALARY in the ACCOUNTING tablespace, with indexes for that table in ACCOUNT_IDX tablespace.

The ACCOUNTING and ACCOUNT_IDX tablespaces need to be created in a separate script that has CREATE TABLESPACE statements.

If you look at the syntax for CREATE TABLESPACE, the USING part of the statement will tell DB2 where to put the files for the tablespace.

DB2 Create Tablespace Reference

Michael Sharek