Bug #15975 Optional parameters support in stored procedures
Submitted: 24 Dec 2005 16:49 Modified: 25 Dec 2005 6:22
Reporter: Roberto Meardi Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S4 (Feature request)
Version:5.0, 8.0 OS:Windows (Windows)
Assigned to: CPU Architecture:Any

[24 Dec 2005 16:49] Roberto Meardi
Description:
I've been using MSSQL for a couple of years. I write almost all the sql statements in stored procedures, so I can encapsulate data logic, that can be changed later without recompiling my application.
In MySQL v5.0 you came out with Stored Procedure support, so I downloaded it and began using it. Currently I'm translating my stored procedures in mssql to mysql. But I've come with a BIG problem. MySQL stored procedures do not support optional parameters, so, if I want to change my undelying database system, I'd have to write almost all the data access layer for my applications.
This is why I'm requesting Optional Parameters support for Stored Procedures...

How to repeat:
Feature request
[25 Dec 2005 6:22] Valeriy Kravchuk
Thank you for a useful feature request. By optional parameter you mean the one with default value, I believe... So, that the value for it can be ommited in the SP call. Oracle's PL/SQL also has this feature. I think it should be implemented as soon as possible to simplify migration from other RDBMS to MySQL 5.
[3 Sep 2009 7:46] The Assimilator
Please advise of the status of this bug. Has this been implemented yet? If so, what version of MySQL is it available in? And if not, why not?
[20 Sep 2009 10:52] Meir Guttman
I cannot stress enough the importance of such!
Any plans for implementing this???
Meir
[13 Feb 2011 10:42] john knowles
I would also like to add my request for this addition as well as I cannot find any reference to this in current versions.
[5 Mar 2011 18:33] Valeriy Kravchuk
Bug #60355 was marked as a duplicate of this one.
[15 May 2011 5:03] Ivan Alagenchev
Wow, this bug is from 2005 and the MySQL team hasn't decided to fix it yet? 
I would like to bump this, since I think it's a needed feature.
[25 May 2011 19:27] Jessica Lindsay
Please implement this feature.
[31 Aug 2011 19:09] Andrew Blake
Yes, please do this! Every comment so far is in support of this important feature. Over five years have passed. Thanks!
[20 Apr 2012 13:36] Erik Schoel
Please support this ASAP! This is really inconvenient.
[23 May 2012 17:36] Mudit Vaidya
It would be really nice to have default values. Please add this feature asap.
[30 Dec 2012 6:48] MySQL Verification Team
http://bugs.mysql.com/bug.php?id=67201 is a duplicate
[17 May 2013 15:32] Anthony Hache
Dear god, PLEASE implement this.. 
This would make my work load SOO much easier to handle.

I really don't understand why this feature hasn't been implemented yet. =/
[20 May 2013 13:51] John Davis
Please do implement this. It would be very useful for MySQL to have this simple feature that is available in most mature databases.
[19 Feb 2014 5:14] MySQL Verification Team
bug #71765 is a duplicate
[24 Sep 2014 16:43] Alex Silverstein
Please add this feature. Almost 10 years since it was first formally requested.
[5 Jan 2015 18:48] vijayarajan p
It's very disappointing me.
kindly add this features ASAP.

Thanks in Advance.
[10 Mar 2015 3:10] John Skolits
This would be a great feature for backward compatibility. I'm surprised it's been on the ToDo list for almost 10 years. Any chance of this happening?
[27 Dec 2015 23:03] Romina Valladares
Ten years already...
[15 Mar 2016 8:12] Aleksandar T
Why is this so difficult to implement? 
This is supported by all modern systems, and indeed it would be very useful. 
Can we get some information about whether the resolution of this problem come to the table and when? 

Thanks in advance.
[21 Jun 2016 9:01] Antonio Angelo
Please do implement this. It would be very important for MySQL to have this simple feature that is available in most mature databases since many years.
[3 Aug 2016 16:02] Chris Hill
I have literally created an account just to request this feature.
It seems crazy that the syntax exists in the language yet there is this restriction on what should be a simple implementation - c'mon Oracle show us you are listening :)
[20 Dec 2016 15:11] Stuart Hankins
This functionality is needed. Please add my vote.
[30 Jan 2017 22:16] Lindsay Wert
I will add my vote as well.  I primarily use MySQL, so I have little concern with porting from other platforms.

My main reason is for maintainability when there are many client systems.  If a procedure update is made requiring an additional parameter, the installed base will throw an error when the parameter is not present, thus requiring simultaneous updates for all client installations.  

The obvious work-around is creation of a new procedure with a different name, but I find that disagreeable because of the proliferation of procedures with essentially the same functionality.
[24 Aug 2017 13:38] Seb A
Please can we have an update from MySQL on this issue. This is a serious shortcoming of MySQL database.
[5 Oct 2017 21:28] Glenn Benge
I, like others, are converting stored procs from MSSQL to MySQL and this missing feature is problematic.
[10 Oct 2017 12:37] dAVE Wave
Please can we have default values for parameters.
[12 Dec 2017 1:59] Manhao Chen
12 years later.....

still no updates if this is supported yet?
[21 Feb 2018 20:01] Zachary NOT_FOUND
Agreed - I'm moving some databases from MSSQL to MySQL - almost sorry I'm doing so with optional parameters missing.  Even a default value would help simplify things.
[14 Jul 2018 13:19] Dirk Potgieter
+1 - My company develops for both MSSQL and MySQL platforms. The lack of this functionality makes the MySQL implementations harder - the delivery on this platform always lags behind MSSQL.
[14 Jul 2018 13:20] Dirk Potgieter
+1 - My company develops for both MSSQL and MySQL platforms. The lack of this functionality makes the MySQL implementations harder.
[5 Nov 2018 3:13] Xiangyu Hu
LoL. 13 years.
[9 Jan 2019 23:26] Cesar Martinez
Please do implement this!
[28 Feb 2019 16:00] Matt Parkinson
Please implement this feature.
[3 May 2019 3:48] Venkat Hariharan
This is an absolutely required feature. And from the looks of it, I'd imagine it's not too hard to implement.

But yet if it's not getting implemented even 15 years after after requesting for it, then I can only surmise that the reason is that Oracle wants its flagship Oracle database product to retain some competitive feature edge over the MySQL database product. Else there may not be too many takers for its flagship product, if what it gives away for free starts coming closer in feature-list to its flagship paid product!

From one point of view, thats quite understandable.
[3 Jun 2021 9:59] IGG t
still no change on this ?????
[19 Dec 2022 9:02] tom ming
still unsupported?
[25 Jan 2023 5:56] MySQL Verification Team
Bug #109754 marked as duplicate of this one