Is it possible to have a default parameter for a mysql stored procedure?

前端 未结 6 988
情话喂你
情话喂你 2020-11-30 02:44

I have googled this and keep coming up with \"No it is not possible\" but these posts were dated 2005-2007 so I\'m wondering if this has been changed. A code example:

<
6条回答
  •  甜味超标
    2020-11-30 03:25

    SET myParam = IFNULL(myParam, 0);
    

    Explanation: IFNULL(expression_1, expression_2)

    The IFNULL function returns expression_1 if expression_1 is not NULL; otherwise it returns expression_2. The IFNULL function returns a string or a numeric based on the context where it is used.

提交回复
热议问题