Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006

    Unanswered: Informix "for update" cursor

    Any one had any idea if the for update CURSOR can be used for the following selection together with the order by:

    let sql_str = "select * from tableA where ctry_cd = 'AA' ",
    " for update ",
    " order by accnt_no desc "

    prepare stmt1 from sql_str
    declare cur1 cursor for stmt1

    Facing runtime error while executing the binary.
    SQL statement error number -201.
    A syntax error has occurred.

  2. #2
    Join Date
    Dec 2003
    North America
    It's been a long time since I've looked at 4gl code but I'm pretty sure that you can't use the "order by" clause with an update cursor.

    Here's the syntax I found in some old documentation:

    let sqlstmt1 = "select * from tableA where cntry_cd = 'AA'"
    prepare statement3 from sqlstmt1
    declare my_cursor cursor for statement3 for update

    I also have seen this syntax used:

    declare my_cursor cursor for
    select * from tableA where cntry_cd = "A"
    for update

  3. #3
    Join Date
    Nov 2006
    yes it's ok

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts