Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,979
    Thanks
    120
    Thanked 76 Times in 76 Posts

    Stored proc, cursor, No data - zero rows fetched, selected, or processed

    This loops fine, except it newer gets to LOG POINT 2 or LOG POINT 3

    LOG POINT 1, does not occur at last record in cursor, which is OK.

    proc dies with, error caught in java:
    No data - zero rows fetched, selected, or processed

    Don't see why is that.

    Code:
          OPEN cur;
    
          FETCH cur INTO c_tmp_str;
    
          WHILE NOT eof DO
    
          
            SET i_optional_inf = 0 + c_tmp_str;
    
    
            insert ignore into galery_optional_inf
            (
              id_galery,
              id
            )
            VALUES
            (
              i_id_galery,
              i_optional_inf
            );
    
            FETCH cur INTO c_tmp_str;
            //LOG POINT 1
          END WHILE;
    
          //LOG POINT 2
    
          CLOSE cur;
    
          //LOG POINT 3
    Last edited by BubikolRamios; 04-19-2011 at 09:09 AM.
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • #2
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,979
    Thanks
    120
    Thanked 76 Times in 76 Posts
    ahh , forgot to add:

    Code:
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET eof = 1;
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,561
    Thanks
    80
    Thanked 4,495 Times in 4,459 Posts
    Yeah, it's a pretty ridiculous syntax, isn't it? You'd think we could simply do something like
    Code:
    DO
        SELECT ...;
    UNTIL NOT FOUND;
    or something along those lines.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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