Bug #13853 Easy record types for cursors and tables
Submitted: 7 Oct 2005 18:57 Modified: 15 Dec 2010 11:07
Reporter: Andre Timmer Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:MySQL 5 OS:Any (All)
Assigned to: CPU Architecture:Any

[7 Oct 2005 18:57] Andre Timmer
Description:
This would speed up development.

It's a real drag if you want to pass many variables to for example a procedure that handles inserts or updates.

It's also error prone.

How to repeat:
.

Suggested fix:
Example for inspiration

DECLARE cur  CURSOR FOR SELECT col1, col2 FROM t2;
DECLARE rec  cur%rowtype;
DECLARE rec2 a_real_table%rowtype;

OPEN cur;

  REPEAT
    FETCH cur INTO rec;

    IF (rec.col1 = ...) THEN
        CALL insert_into_history(rec);
    END IF

   INSERT INTO t3 VALUES (reccol1, rec.col2);
  UNTIL done END REPEAT;

CLOSE cur;
[15 Dec 2010 11:07] Valeriy Kravchuk
This is a duplicate of Bug #3286.