Start a new topic

Import Parameter not working for temp tables in db2

Hi,


when I use the @import parameter for temp tables with db2/zos I get an error message when trying to import. Can this please be investigated?


Thanks,


Alex


DECLARE GLOBAL TEMPORARY TABLE SESSION.myTable4

 (

 myColumn varchar(1000),

 )

ON COMMIT PRESERVE ROWS;

 

@import on;

@import set ImportSource="myPath\test.csv";

@import parse;

@import target Table="SESSION.myTable4";

@import execute;

@import off;



Hi Alex.


Please try using the Schema parameter for @import target.


I.e as:


@import target Schema="SESSION"  Table="myTable4";


Kind Regards


Ulf

Hi,


unfortunately same result :-)


Thanks,


Alex


image


Hi Alex


I were able to repeat this on DB2 LUW. It seems like when using DECLARE there is no persistent definition in the DB2 system catalogs for the temporary table. DbVisualizer

is dependent on this. (See https://www.ibm.com/support/pages/sql0204-returned-declared-global-temporary-table for a similar problem).


I managed to import using CREATE GLOBAL TEMPORARY  instead  as indicated by the Script below.
 

CREATE GLOBAL TEMPORARY TABLE "myTable4" (
 myColumn varchar(100)
)

ON COMMIT PRESERVE ROWS;
 
@import on;
@import set ImportSource="/Users/ulf/tmp/test.csv";
@import parse;
@import target Table="myTable4";
@import execute;
@import off;


The result of executing this script was


Kind Regards


Ulf


1 person likes this

Hi there,


I have tested this, but I get a permission error.

I will ask my db department but the topic is solved for the moment.


Thanks,


Alex 

Great


Kind Regards 


Ulf

Login or Signup to post a comment