IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  updating a column in a table using JDBC adapter

    Posted 7 days ago

    Hi,

    I am getting "ORA-01002: fetch out of sequence" error while updating a column in a table using update query in JDBC adapter as below.

    The below query update a row in plsql but getting error with jdbc adapter.

    This GET function passed in side a function map to update the count column for each id.so for each iteration it supposed to update the column in the table.

    is it possible in this way or i need to follow traditional way of creating a type tree of the table with DB adapter with -UPDATE only parameter.

    GET("JDBC","-URL <url> -USER <userid> -PASSWORD <pwd> -T -AS 0 -QTY * -LSN 0 -QUERY ""update <tablename> set count='"+Count+"' where id= '" +id+"' and id1='"+id1+"' ")

    Error from Trace file

    Caused by: Error : 1002, Position : 0, Sql = update <tablename> set count='1' where id= '11' and id1='111', OriginalSql = update <tablename> set count='1' where id= '11' and id1='111', Error Msg = ORA-01002: fetch out of sequence

    Thanks

    Santanu



    ------------------------------
    Santanu Baral
    ------------------------------


  • 2.  RE: updating a column in a table using JDBC adapter

    Posted 5 days ago

    Your logic seems somewhat contradictory to me. Maybe it's just my perspective, but I use the GET function to retrieve or read data from tables, and the PUT function for inserting or updating records.



    ------------------------------
    Akhi Singh
    ------------------------------



  • 3.  RE: updating a column in a table using JDBC adapter

    Posted 4 days ago

    I believe we can't use -QUERY parameter with PUT function...it only works with Inputcard,GET and Outputcard.Adapter is able to execute the update query but ended with exception.Also i could see in the document that -QUERY parameter only can be used to fetch data so i believe we can't update table with using -QUERY parameter with JDBC adapter.

    Can someone please confirm whether my understanding is correct?

    Thanks

    Santanu



    ------------------------------
    Santanu Baral
    ------------------------------



  • 4.  RE: updating a column in a table using JDBC adapter

    Posted 4 days ago
    You can use DML command instead of QUERY with PUT function.
     
        -DML statement_text.


    ------------------------------
    Akhi Singh
    ------------------------------



  • 5.  RE: updating a column in a table using JDBC adapter

    Posted 3 days ago

    This works for me.  I got it from an example map.  My knowledge of JDBC adapter is limited.

    =VALID(PUT("JDBC", "-URL jdbc:mysql://testserver:3306/testdb?verifyServerCertificate=false&useSSL=false&serverTimezone=UTC -USR testuser -PWD testpassword -DML 'UPDATE testtable SET c2=\'TestValue\' WHERE c1=?'", text(F1 Field:KeyData)), FAIL(LASTERRORMSG()))



    ------------------------------
    Rex Chan
    ------------------------------



  • 6.  RE: updating a column in a table using JDBC adapter

    Posted 3 days ago

    Thank you so much for your help.



    ------------------------------
    Santanu Baral
    ------------------------------