Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Posts
    7

    Unanswered: create table as select statement

    Can anyone help me w/ the query below. I am trying to create a table from another table.

    SQL:
    create table cca8380.testing as select * from card.mktg_cmpgn;

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Have a look into the CREATE TABLE Statement in SQL reference corresponding to your platform, version of your product

    Cheers
    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    In Ver 8.1 you can also do CREATE TABLE x like MyTable....

    It can do more than "as select *..."

    Andy

  4. #4
    Join Date
    Feb 2004
    Location
    Copenhagen
    Posts
    220

    Arrow

    But usually:

    create table x.y as (select statement) definition only

    Will work

    B.O.W.
    Kristian K. Hansen
    Project Supervisor
    National Board of Health

  5. #5
    Join Date
    May 2002
    Location
    General Deheza, Cba, Arg.
    Posts
    276
    you can copy a table whit the export/import statement, example:

    EXPORT TO "E:\PROGRA~1\IBM\SQLLIB\WEBCPTAB.IXF" OF IXF MESSAGES "E:\PROGRA~1\IBM\SQLLIB\WEBCPTAB.EXM" SELECT * FROM DB2DWAD1.A0_2MESESATRAS;

    IMPORT FROM "E:\PROGRA~1\IBM\SQLLIB\WEBCPTAB.IXF" OF IXF MESSAGES "E:\PROGRA~1\IBM\SQLLIB\WEBCPTAB.IMM" CREATE INTO DB2INST1.NEWTABLE IN TBATTRIB INDEX IN TBINDEX LONG IN TBLOB;


    Quote Originally Posted by cartjohn
    Can anyone help me w/ the query below. I am trying to create a table from another table.

    SQL:
    create table cca8380.testing as select * from card.mktg_cmpgn;

Posting Permissions

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