SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mysql Empty set error

    Guys,

    I can run an update query from command line and it updates records but if I'm running same query from a procedure it returns empty set. Any idea why? The update query is below.

    1. Create function Age

    2. Update table set column1 = Age(column2)

    3. CREATE DEFINER = 'root'@'localhost' PROCEDURE `Age_new`()
    NOT DETERMINISTIC
    MODIFIES SQL DATA
    SQL SECURITY DEFINER
    COMMENT ''
    BEGIN
    Update Related Set Age = Age(column2);
    END;

    4. call Age_new

  2. #2
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,014
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    What language is the procedure, ie php, asp, etc?

    What database server are you using, ie MySQL, MsSQL, etc?

    What errors if any is the database server returning?
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  3. #3
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its MYSQL database and its a stored procedure in mysql.

    This is not exactly an error. It doesnt update records when calling update command from a procedure.

  4. #4
    SitePoint Member
    Join Date
    Apr 2010
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, Since I am learning to write procs in MySQL, I checked your code and with just modifications to columns in my test databases the code ran fine [MySQL 5.1.46 - under Vista]. If I ran as another user than root@localhost with minimal rights, i.e. only Execute it also ran fine.

    The last weeks learning procs in MySQL, I have been known to forget to drop a procedure and thus been running the old version of procs...with similar - that is - no changes in records, but you're probably past that...

    And I have also forgotten to set back autocommit=1 and had no COMMIT in the procs - many grey hair these last weeks.

  5. #5
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems that empty set is just an information message. I didn't check the data so far. The proc does updates records.


Bookmarks

Posting Permissions

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