when i use this sql command in STRSQL there is no problem and i can see all data. But i use these sql command in java program, run type xx.execute(...) is false. other run type xx.executequery(....) error message "cursor state not valid" .
jdk 6.10 , AS400 R5M4, JT400 v6.7 connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
SQL = with f1(STID , PINBR , CINBR , QTYPR) as (select STID , PINBR , CINBR , QTYPR from PSTDTL where STID = 'PRO' and PINBR = '<crt_01>') select * from f1
I was not able to recreate this with JTOpen 7.0. Can you provide a sample program to create the necessary tables and recreate the problem?
This seems to be fixed with the latest JTOpen.
Here is the output of a sample program.
sql400>callmethod STMT.execute("with f1(IBMREQD) as (select IBMREQD from sysibm.sysdummy1) select * from f1")
callmethod STMT.execute("with f1(IBMREQD) as (select IBMREQD from sysibm.sysdummy1) select * from f1")
Call returned true
sql400>setvar RS=STMT.executeQuery("with f1(IBMREQD) as (select IBMREQD from sysibm.sysdummy1) select * from f1")
setvar RS=STMT.executeQuery("with f1(IBMREQD) as (select IBMREQD from sysibm.sysdummy1) select * from f1")
RS=CRSR0002
sql400>CALLMETHOD test.JDSQL400.dispResultSet(RS)
CALLMETHOD test.JDSQL400.dispResultSet(RS)
IBMREQD
Y
Call returned null