Bug #3286 Enhancement to Stored Procedure variables
Submitted: 24 Mar 2004 10:13 Modified: 2 Dec 2005 17:42
Reporter: Lynette Halka-Peel Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S4 (Feature request)
Version:5.0 alpha OS:Windows (Windows 2000)
Assigned to: CPU Architecture:Any

[24 Mar 2004 10:13] Lynette Halka-Peel
Description:
I would like to avoid specifying the exact type and column length of a variable in a stored procedure when using cursors.  For example, instead of declare vendorNbr varchar(16), I want to use a feature like Oracle has:  declare vendornbr my_Table.vendorNbr%TYPE;   This will make maintenance easier for when column lengths change.  

How to repeat:
n/a

Suggested fix:
implementation of a way for a stored procedure variable to inherit it's data type and column length from the table specified.
[2 Dec 2005 17:42] Valeriy Kravchuk
Thank you for a reasonable feature request. Yes, Oracle PL/SQL's %TYPE (and %ROWTYPE) attributes are useful. I hope something similar will be implemented in MySQL some day.
[12 Nov 2008 6:41] Valeriy Kravchuk
Bug #40593 was marked as a duplicate of this one.
[18 Feb 2010 18:39] Valeriy Kravchuk
Bug #51290 was marked as a duplicate of this one.
[15 Dec 2010 11:08] Valeriy Kravchuk
Bug #13853 was marked as a duplicate of this one.
[29 May 2012 13:45] Valeriy Kravchuk
Bug #17515 was marked as a duplicate of this one.