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 > Informix > Creating Table & index in different dbspaces

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-17-03, 07:46
lloydnwo lloydnwo is offline
Registered User
 
Join Date: Aug 2003
Location: India
Posts: 262
Creating Table & index in different dbspaces

Hi all,

I would like to know whether we can create a table & index in different dbspaces in one command. We can create it in oracle, below is the code

CREATE TABLE TEST
(
COL1 NUMBER(4) CONSTRAINT PK_TEST_COL1
PRIMARY KEY
USING INDEX TABLESPACE OFMIDX,
COL2 varchar2(4),
COL3 date )
TABLESPACE USERS

Can we do the same in informix, if yes, please give me the syntax.

Regards,

lloyd
Reply With Quote
  #2 (permalink)  
Old 11-13-03, 01:46
sayasaya sayasaya is offline
Registered User
 
Join Date: Oct 2003
Posts: 9
Re: Creating Table & index in different dbspaces

Yes you can create by adding IN key word to your earlier statement

CREATE TABLE TEST
(
COL1 NUMBER(4) CONSTRAINT PK_TEST_COL1
PRIMARY KEY
USING INDEX TABLESPACE OFMIDX,
COL2 varchar2(4),
COL3 date ) IN
TABLESPACE USER
Reply With Quote
  #3 (permalink)  
Old 11-13-03, 06:48
gurey gurey is offline
Registered User
 
Join Date: Aug 2003
Location: Argentina
Posts: 780
Re: Creating Table & index in different dbspaces

Quote:
Originally posted by lloydnwo
Hi all,

I would like to know whether we can create a table & index in different dbspaces in one command. We can create it in oracle, below is the code

CREATE TABLE TEST
(
COL1 NUMBER(4) CONSTRAINT PK_TEST_COL1
PRIMARY KEY
USING INDEX TABLESPACE OFMIDX,
COL2 varchar2(4),
COL3 date )
TABLESPACE USERS

Can we do the same in informix, if yes, please give me the syntax.

Regards,

lloyd
Hi Lloyd,

This syntax is of Oracle, for Informix is
CREATE TABLE TEST
(
COL1 type .... CONSTRAINT PK_TEST_COL1
PRIMARY KEY,
COL2 type .... ,
) extent size xx next size xx in dbspace name;

The primari key index will build in dbspace from the table exist, now if you not want this then create of table without primary key, then run create unique index ..... in dbspace name.

Gustavo.
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