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
https://forums.phpfreaks.com/topic/158384-having-problem-creating-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.