Bug #35204 Arrays as Variables in Stored Procedures
Submitted: 11 Mar 2008 9:21 Modified: 11 Mar 2008 21:52
Reporter: Frank Mussmann Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S4 (Feature request)
Version:5.1.22 OS:Linux
Assigned to: CPU Architecture:Any
Tags: array, DECLARE, PROCEDURE, stored, type, variable

[11 Mar 2008 9:21] Frank Mussmann
Description:
It's only possible to create (i call it straight) variables in stored procedures. I think it would be great to have arrays in stored procedures (Hashes would be excellent :-) ).

How to repeat:
No way to repeat

Suggested fix:
DECLARE A INT AS ARRAY [MAXVALUE]
- Set A[1]=1;
  Set A[2]=2;
DECLARE B VARCHAR(20) AS ARRAY [MAXVALUE]
- Set A[1]='Hello';
  Set A[2]='World';
How to detect the numbers of values of the array 
DECLARE I INT 0;
DECLARE A INT AS ARRAY [MAXVALUE]
 SET A[1]=1;
 SET A[2]=2;
WHILE (I<@A) DO   <--- @A would represent the numbers of values in this case 2
 ... do something
END WHILE;

This would make coding Stored procedures easier.
[11 Mar 2008 9:22] Frank Mussmann
I just changed the synopsis :-)
[11 Mar 2008 21:52] Valeriy Kravchuk
Thank you for a reasonable feature request.