Quantcast
Channel: Is it possible to have a default parameter for a mysql stored procedure? - Stack Overflow
Browsing all 7 articles
Browse latest View live

Answer by SKManX for Is it possible to have a default parameter for a mysql...

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

View Article



Answer by Ross Smith II for Is it possible to have a default parameter for a...

Unfortunately, MySQL doesn't support DEFAULT parameter values, so:CREATE PROCEDURE `blah`( myDefaultParam int DEFAULT 0)BEGIN -- Do something hereENDreturns the error:ERROR 1064 (42000): You have an...

View Article

Answer by Dive50 for Is it possible to have a default parameter for a mysql...

We worked around this limitation by adding a simple IF statement in the stored procedure. Practically we pass an empty string whenever we want to save the default value in the DB.CREATE...

View Article

Answer by Bill Karwin for Is it possible to have a default parameter for a...

No, this is not supported in MySQL stored routine syntax.Feel free to submit a feature request at bugs.mysql.com.

View Article

Answer by Michael for Is it possible to have a default parameter for a mysql...

If you look into CREATE PROCEDURE Syntax for latest MySQL version you'll see that procedure parameter can only contain IN/OUT/INOUT specifier, parameter name and type.So, default values are still...

View Article


Answer by Paul Sonier for Is it possible to have a default parameter for a...

It's still not possible.

View Article

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

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:CREATE PROCEDURE `blah`(...

View Article
Browsing all 7 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>