Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Posts
    24

    Question Unanswered: Temporary Tables

    Using db2 8.1.3 Personal Edition on w2k.
    Im trying to figure out how to create temporary tables.
    In my current context, Im altering tables, and the ALTER TABLE sql statement, doesnt do what I want it to do...

    First I just want to verify that temporary tables cannot contain CLOB fields?
    I got this from the Information Center ->
    "Note that BLOB, CLOB, DBCLOB, LONG VARCHAR, LONG VARGRAPHIC, DATALINK, reference, and structured types cannot be used with declared global temporary tables (SQLSTATE 42962)."
    I need to know if this is really true, as that may hamper me down the road....

    Current problem.
    I have a table with this structure ->
    CREATE TABLE "NULLID "."BLOCKS" (

    "BID" VARCHAR(16) NOT NULL WITH DEFAULT '0' ,

    "SIDE" SMALLINT NOT NULL WITH DEFAULT 0 ,

    "GROUPS" VARCHAR(50) NOT NULL WITH DEFAULT '' ,

    "BLOCK_FILE" VARCHAR(50) NOT NULL WITH DEFAULT '' ,

    "TITLE" VARCHAR(50) NOT NULL WITH DEFAULT '' ,

    "CONTENT" VARCHAR(25) NOT NULL WITH DEFAULT '' )

    IN "USERSPACE1" ;

    When trying to create a temporary table, Im getting ->
    db2 => declare global temporary table foo like nullid.blocks
    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL0286N A default table space could not be found with a page size of at
    least "4096" that authorization ID "ADMINISTRATOR" is authorized to use.
    SQLSTATE=42727

    Could anyone point out where Im going wrong with this?
    Thanks

  2. #2
    Join Date
    Jun 2004
    Posts
    39
    You have to create a temporary tablespace (with an user with admin rigth) then granting access to this tablespace for your user. After that, you will be able to create your temporary table.
    geoffrey
    - Four J's Development Tools -

Posting Permissions

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