Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Location
    India
    Posts
    262

    Unanswered: 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

  2. #2
    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

  3. #3
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    780

    Re: Creating Table & index in different dbspaces

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •