Hi,
anybody knows how to use temporary table in java SP on DB2 v8.1.4?

The following SP compiles and works just fine in DB2 v7.2
but it gives an error while build in Development Center on DB2 v8.1.4
(build output follows the SP code)

/*
* SQLJ Stored Procedure TEST3
*
* Test SESSION objects
*
*/

import java.sql.*;
import sqlj.runtime.*;
import sqlj.runtime.ref.*;

#sql context SPContext;
#sql iterator TEST3_Cursor3 (int);

public class TEST3
{
public static void sEST3 ( int[] RETVAL,
int[] SQLCODE,
String[] SQLSTATE,
String[] SQLMessage,
ResultSet[] rs ) throws Exception
{
RETVAL[0] = 0;
SQLCODE[0] = 0; // Good SQLCODE
SQLSTATE[0] = "00000"; // Good SQLSTATE
SQLMessage[0] = " "; // Good SQLMessage

TEST3_Cursor3 cursor3 = null;

SPContext ctx = null;
ctx = new SPContext( "jdbc:default:connection", false );
Connection cn = ctx.getConnection();

try
{
Statement stm = cn.createStatement();
stm.executeUpdate("DECLARE GLOBAL TEMPORARY TABLE STOREID ( STORE_ID INTEGER ) NOT LOGGED WITH REPLACE");

int storeId = 1;

#sql [ctx]
{
INSERT INTO SESSION.STOREID VALUES(:storeId)
};

#sql [ctx] cursor3 =
{
SELECT STORE_ID
FROM SESSION.STOREID
};

rs[0] = cursor3.getResultSet();
}
catch (SQLException e)
{
// Set return parameters
SQLSTATE[0] = e.getSQLState();
SQLCODE[0] = e.getErrorCode();
SQLMessage[0] = e.getMessage();
RETVAL[0] = -100;

// Close open resources
try
{
if (cursor3 != null) cursor3.close();
if (ctx != null) ctx.close();
} catch (SQLException e2) { /* ignore */ };
}
}
}

Build output
--------------

DB2ADM.TEST3 - Build started.
C:\IBM\SQLLIB\bin\sqlj -compile=false -profile=false -ser2class=false TEST3.sqlj
DB2ADM.TEST3 - SQLJ precompilation completed.
C:\IBM\SQLLIB\java\jdk\bin\javac -classpath ".;C:\IBM\SQLLIB\java\db2java.zip;C:\IBM\SQLLIB\ja va\runtime.zip;C:\IBM\SQLLIB\java\sqlj.zip" "TEST3.java"
DB2ADM.TEST3 - Javac completed.
DB2ADM.TEST3 - Class file updated.
C:\IBM\SQLLIB\java\jdk\bin\java -cp ".\;C:\IBM\SQLLIB\java\db2jcc.jar;C:\IBM\SQLLIB\ja va\db2jcc_license_cisuz.jar;C:\IBM\SQLLIB\java\db2 jcc_license_cu.jar" com.ibm.db2.jcc.sqlj.Customizer -url jdbc:db2://localhost:50000/JCXS -collection DB2ADM -user db2adm -password xxxxxxxx -rootPkgName S103111 -path "C:\J\DB2Project\bld1076006651346" TEST3_SJProfile0.ser
[ibm][db2][jcc][sqlj]

[ibm][db2][jcc][sqlj] Begin Customization

[ibm][db2][jcc][sqlj] Loading profile: TEST3_SJProfile0

[ibm][db2][jcc][sqlj] Failed to online-check the following statement:

[ibm][db2][jcc][sqlj] INSERT INTO SESSION.STOREID VALUES( ? )

[ibm][db2][jcc][sqlj] "SESSION.STOREID" is an undefined name.

[ibm][db2][jcc][sqlj] SQL Error - SQLCODE : -204, SQLSTATE : 42704

[ibm][db2][jcc][sqlj] Customization continuing...customizer will guess metadata

[ibm][db2][jcc][sqlj] Failed to online-check the following statement:

[ibm][db2][jcc][sqlj] SELECT STORE_ID FROM SESSION.STOREID

[ibm][db2][jcc][sqlj] "SESSION.STOREID" is an undefined name.

[ibm][db2][jcc][sqlj] SQL Error - SQLCODE : -204, SQLSTATE : 42704

[ibm][db2][jcc][sqlj] Customization continuing...customizer will guess metadata

[ibm][db2][jcc][sqlj] Customization complete for profile C:\J\DB2Project\bld1076006651346\TEST3_SJProfile0. ser

[ibm][db2][jcc][sqlj] Begin Bind

[ibm][db2][jcc][sqlj] Loading profile: TEST3_SJProfile0

[ibm][db2][jcc][sqlj] Driver defaults(user may override): BLOCKING ALL VALIDATE BIND STATICREADONLY YES

[ibm][db2][jcc][sqlj] Fixed driver options: DATETIME ISO DYNAMICRULES BIND

[ibm][db2][jcc][sqlj] Binding package S1031111 at isolation level UR

[ibm][db2][jcc][sqlj] Binding package S1031112 at isolation level CS

[ibm][db2][jcc][sqlj] Binding package S1031113 at isolation level RS

[ibm][db2][jcc][sqlj] Binding package S1031114 at isolation level RR

[ibm][db2][jcc][sqlj] Bind complete for TEST3_SJProfile0


DB2ADM.TEST3 - SQLJ profile customization completed.
C:\IBM\SQLLIB\java\jdk\bin\jar cf TEST3.jar SPContext.class TEST3.class TEST3_Cursor3.class TEST3_SJProfile0.ser TEST3_SJProfileKeys.class
DB2ADM.TEST3 - Jar file created.
Call sqlj.replace_jar ('file:///C|/J/DB2Project/bld1076006651346/TEST3.jar', '"DB2ADM".TEST3', 0)
DB2ADM.TEST3 - sqlj.replace_jar using jar name "DB2ADM".TEST3 completed.
Call sqlj.refresh_classes( )
DB2ADM.TEST3 - sqlj.refresh_classes completed.
Call sqlj.updatejarinfo ('"DB2ADM".TEST3', 'TEST3', 'file:///C|/J/DB2Project/bld1076006651346/dc_1')
DB2ADM.TEST3 - Source updated.
DB2ADM.TEST3 - Package S1031111 created.
DB2ADM.TEST3 - Package S1031112 created.
DB2ADM.TEST3 - Package S1031113 created.
DB2ADM.TEST3 - Package S1031114 created.
DB2ADM.TEST3 - Build successful.

------------------------------------------------------------------------------

Customizer reported -204 code.
Though it still biulds this small test SP ([ibm][db2][jcc][sqlj] Customization continuing...customizer will guess metadata), but
on "bigger" SP with many references to SESSION object customiser
gives up ...

Is it a bug in customizer or there is some way around ?

Regards
Vlad