dynamic cursors in mysql

I have a problem in writing a dynamic cursor

CREATE PROCEDURE testassign(IN testdb varchar(50))
BEGIN
DECLARE a varchar(50);
DECLARE b varchar(50);
set [at] tab1 = "SELECT test1,test2 FROM testdb.testtable;";
DECLARE curtest CURSOR FOR [at] tab1
OPEN curtest;
FETCH curtest INTO a, b;
CLOSE curtest;
SELECT a ,b ;
END//

actually the purpose of me writing this dynamic cursor is i will get
the database name as a input parameter and my cursor should select the
data accordingly.

but im not able to do the same. can anyone help me out with different
solution.
dbkarthik [ Fr, 30 März 2007 10:18 ] [ ID #1673715 ]
Datenbanken » mailing.database.mysql » dynamic cursors in mysql

Vorheriges Thema: Multiplying matches, complex query
Nächstes Thema: mysqlhotcopy