ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Sqlcode = -420

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sqlcode = -420

    Hi guys,

    I have an issue and I need your help please, it is something like this:

    - I have cursor
    declare cursor mycursor
    select column1, column2 etc (a lot of columns) from mytable
    group by column1, column2,..
    order by column1, column2, ..

    exec sql
    open mycursor
    dow sqlocode=0;
    exec sql
    fetch mycursor
    into :vcolumn1, vcolumn2 etc
    if sqlcode = 0; ---> sqlcode=-420 after the fetch
    --> the rest of traitement --> I don't

    else;
    error

    briefly I have an issue when it tries to make the fetch, I have an sqlcode=-420 and sqlstate=22018, it is a problem with one of the variables where it tries to load the values retrieved by the select statement?
    How can I found exactly the column and the variable ko, with problems? I think it is a problem with data types of a variable in the fetch statement,..
    the variables of the fetch statement was declared with like other zones of another file, it is possible to be changed one of them or I don't know why it doesn't work anymore
    and I have a lot of columns in the select statement& a lot of variables in the fetch statement
    Thanks

  • #2
    i would put it in debug, the message that you get might say the column name in the job log. I can't recall if it does.
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

    Comment


    • #3
      Do you have a cast function in your statement anywhere? Maybe start with that one/those as IBM's SQL Finder says
      Cause Text: A character in the argument for the CAST function was not correct.
      Recovery Text: Change the result data type to one that recognizes the characters in the CAST argument, or change the argument to contain a valid representation of a value for the result data type. Try the request again."
      btw... Has anyone noticed that the v5r4 SQL Finder doesn't appear to function correctly? http://www.ibm.com/support/knowledge...zalafinder.htm
      I had to use the the v5r2 version. http://publib.boulder.ibm.com/iserie...zalafinder.htm
      Is there a newer version?

      Kit
      www.ecofitonline.com
      DeskfIT - ChangefIT - XrefIT
      Regards

      Kit
      http://www.ecofitonline.com
      DeskfIT - ChangefIT - XrefIT
      ___________________________________
      There are only 3 kinds of people -
      Those that can count and those that can't.

      Comment


      • #4
        Originally posted by kitvb1 View Post
        btw... Has anyone noticed that the v5r4 SQL Finder doesn't appear to function correctly? http://www.ibm.com/support/knowledge...zalafinder.htm
        Try this link as a starting point. Or this one for a more direct link to the V5R4 SQL Finder.

        Tom

        There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

        Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

        Comment


        • #5
          Here is the 7.2 sql reference, http://www.ibm.com/support/knowledge...rbafzintro.htm
          and the 7.2 sql messages http://www.ibm.com/support/knowledge...alakickoff.htm

          Comment

          Working...
          X