Thread: Temporary Tables
07-04-04, 12:30 #1Registered User
- Join Date
- Aug 2003
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....
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.
Could anyone point out where Im going wrong with this?
07-05-04, 05:34 #2Registered User
- Join Date
- Jun 2004
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 -