ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Sql code -514

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

  • Sql code -514

    I have program with sql fetch. For me (I have developer powers on AS/400) it works fine, SQL CODE = 0 and records are fetched into variables.

    But when other person runs my program (he is software tester and has lower powers on AS/400) he gets empty report (I checked his job under debuger, cause it is batch job) and I see that SQL CODE = -514.

    SQLSTATE
    26501 The statement identified does not exist. -514

    What could be the problem? Why it works for me, and for him not?

    EDIT: After prepare and declare cursor he has:
    42501 The authorization ID does not have the privilege to perform the specified operation on the identified object. -551
    And the when trying to open: -514
    What is going on?

    here's code:
    Code:
         c/exec sql
         c+ prepare @SRD from :WREQUS      // WREQUS is statement SELECT ....
         c/end-exec
    
         c/exec sql
         c+ declare @CURS1 cursor for @SRD
         c/end-exec
         
         c/exec sql
         c+ open @CURS1
         c/end-exec
    
         c     SQLCOD        ifge      0                                //here I have code = 0, tester has code = -514 
                                             
         c/exec sql
         c+ fetch @CURS1 INTO
         c+  :QUMOWA , :XSTATUM , :XWARTOF, :QSTID ,
         c+  :XSTATST , :XGRUPA , :XWARTOSC
         c/end-exec

  • #2
    Re: Sql code -514

    What is SQLCODE and/or SQLSTATE after the SQL PREPARE?
    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


    • #3
      Re: Sql code -514

      Problem solved.
      SQL module was compiled with DYNUSRPRF not *OWNER, so there were checking authority ID of statement.

      Comment

      Working...
      X