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 Reply Children
  • 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.