How to assign a null value within a routine in MySQL

1

My question is how can I do in a MySQL routine assign a field to be null eg:

I want to do the same thing that is shown in the line selected in blue in MySQL, that code belongs to SQLServer, How can I assign a null value from MySQL? I have the following routine in MySQL:

I would appreciate your help. Thanks again.

    
asked by Gerardo Ferreyra 25.05.2017 в 02:47
source

1 answer

0

This can work for you

CREATE DEFINER='test'@'%' PROCEDURE 'myProc'(IN myVarParam VARCHAR(40))
BEGIN
  IF myVarParam = '' THEN 
    SET myVarParam = null; 
  END IF;

  ...your code here...
END
    
answered by 25.05.2017 / 02:54
source