SQL Return code = 1054 getting on open cursor

  • 1. I am facing 1054 return code on below cursor while opening the cursor on MySql8 through Visual COBOL 6.

    2. Below cursor is working fine on Mysql5 through server express

    3. Same cursor is running fine in stored proc created on mySql8

    4. Project requires row level lock while fetching the cursor.

    5. Can you please suggest how to make running this cursor on MySql8 through Visual COBOL6.0 with lock on row.

    6.If we comment "for update" lock on Visual COBOL 6, it works fine but it is not satisfying project requirement.

    Cursore :

    exec sql   declare my_cursor cursor for select  date_format (cstrc_date, '%Y%m%d), cstrc_number from cstrctrl where owing_location=:ws-branch order by cstrc_date,cstrc_number for update

Parents
  • What patch update level do you have applied to Visual COBOL 6.0 and what is the exact version of MySQL 8.0 Server/Client you are using?

    You should test with the latest available which is patch update 17 as we did not test against MySQL 8.0 with earlier releases.

    If patch update 17 does not fix the problem then I would recommend opening up a support incident with Customer Care so that we can investigate this further.

  • Hi Chris,

    Thank you for your reply.

    Can you please help me with how to check latest patch available with Visual COBOL also please help me with process of updating patch to Visual COBOL.

    We are using MySql 8.0.27 version and ODBC driver of 8.0.25 version.

Reply Children
  • Hi Sanjay,

    Please open up a support incident with Customer Care and they will walk you through the process of upgrading to the latest patch update. This is not something that I can do on the Community Forum.

    Thanks.

  • Hi Chris,

    We have updated patch 17 of Visual Cobol, but no luck :(, still facing same issue.

  • The documentation of this function can be found here:

    Here is a real simple example where it will allow a user to select any one filename and will then display the selected name. This example uses the constatnts and typedefs defined in the windows.cpy file.

           copy windows.cpy.
           identification division.
           program-id. Program1.
           special-names.
             call-convention 66 is winapi.
           data division.
           working-storage section.
           01 pp                  procedure-pointer.
           01 openfilename-params OPENFILENAMEA.
           01 ret-value           BOOL.
           01 filter              pic x(100)
               value z"All Files" & z"*.*" & x"00".
           01 file-name           pic x(1024) value x"00".
           01 name-size           pic 9(9)    value zeroes.
           procedure division.
               set pp to entry "comdlg32"
               set lstructsize to length of openfilename-params
               set hwndowner to null
               set 1hInstance of openfilename-params to null
               set lpstrfilter to address of filter
               set lpstrCustomFilter to null
               set nFilterIndex to 0
               set lpstrfile of openfilename-params to address of file-name 
               set nMaxFile to length of file-name
               set lpstrFileTitle to null
               set lpstrInitialDir to null
               set lpstrTitle to null
               set Flags of openfilename-params to 0
               set lpstrDefExt to null
            
               call winapi GETOPENFILENAMEA using openfilename-params
                   returning ret-value
               end-call
               if ret-value = 0   *> User clicked on Cancel button
                   display "user pressed cancel"
               else
                   inspect file-name tallying name-size for characters
                       before X"00"  *> string is null terminated
                   display "file-name selected = " file-name(1:name-size)
               end-if
           
               goback.