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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Strange error about a FUNCTION that does not exists.

    I am getting a message from MySQL Workbench that makes no sense to me.
    SELECT update_customers_groups(1) LIMIT 0, 1000 Error Code: 1305. FUNCTION ph_digistore.update_customers_groups does not exist

    The code below is the entirety and should work as far as I can tell.
    This also pops up but, should work. CREATE FUNCTION update_customers_groups() RETURNS INTEGER MODIFIES SQL DATA BEGIN DECLARE email_todo VARCHAR(255); DECLARE my_cursor CURSOR FOR SELECT email FROM wholesale_import_table; OPEN my_cursor; loopty:REPEAT FETCH my_cursor INTO email_todo; UPDATE ds_customers SET pgID = 1 WHERE ds_customers.cEmail = @email_todo; UNTIL done END REPEAT loopty; CLOSE my_cursor; RETURN 0; END; Error Code: 1418. This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
    Yeah, if the FUNCTION errors on creation, the first error will be created too. Just what is wrong? I consulted from many sources on the net for examples.
    Code:
    DELIMITER ;
    
    USE ph_digistore;
    
    DROP FUNCTION IF EXISTS update_customers_groups;
    
    DELIMITER $$
    
    CREATE FUNCTION update_customers_groups() RETURNS INTEGER MODIFIES SQL DATA
    
    BEGIN
    
    DECLARE email_todo VARCHAR(255);
    
    DECLARE my_cursor CURSOR FOR
    SELECT email FROM wholesale_import_table;
    
    OPEN my_cursor;
    
    loopty:REPEAT
    
    FETCH my_cursor INTO email_todo;
    
        UPDATE ds_customers
        SET pgID = 1
        WHERE ds_customers.cEmail = @email_todo;
    
    UNTIL done END REPEAT loopty;
    
    CLOSE my_cursor;
    RETURN 0;
    
    END;
    
    $$
    
    DELIMITER ;
    
    
    SELECT update_customers_groups();
    Last edited by sethleedy; 01-25-2012 at 03:58 PM.

  • #2
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Looking @ Executing procedures and functions
    Might be my permissions. BRB.


  •  

    Tags for this Thread

    Posting Permissions

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