Menu

#309 recursive sql problem in java

JDBC
closed-fixed
None
5
2012-06-11
2010-04-13
Anonymous
No

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

Discussion

  • Jeff Lee

    Jeff Lee - 2010-04-13
    • milestone: --> JDBC
    • assigned_to: nobody --> jeberhard
     
  • John Eberhard

    John Eberhard - 2010-06-01

    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?

     
  • John Eberhard

    John Eberhard - 2012-06-11

    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

     
  • John Eberhard

    John Eberhard - 2012-06-11
    • status: open --> closed-fixed
     

Log in to post a comment.