Jump to content

Having problem creating function


raydona

Recommended Posts

Hi,

  I'm trying to create the following function:

 

DROP FUNCTION IF EXISTS VerifyAnEmployee;

DELIMITER |

CREATE FUNCTION VerifyAnEmployee(surname VARCHAR(15),email VARCHAR(40))

  RETURNS INT

  DETERMINISTIC

  READS SQL DATA

    BEGIN

      DECLARE query INT;

      DECLARE str1 VARCHAR(15);

      DECLARE str2 VARCHAR(40);

    SET str1 = '';

    SET str2 = '';

    SELECT LastName, EmailAddress INTO str1, str2

    FROM Employee

    WHERE LastName = surname AND EmailAddress = email;

  IF(str1 = surname AND str2 = email) THEN SET query = 1;

  ELSE SET query = 0;

  END IF;

RETURN query;

END;

|

  I get the following error:

#1419 - You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

  I don't know what the error means and how to resolve it. I would be grateful for all help.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.