dbTalk Databases Forums  

dynamic cursors in mysql

mailing.database.msql-mysql-modules mailing.database.msql-mysql-modules


Discuss dynamic cursors in mysql in the mailing.database.msql-mysql-modules forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dbkarthik@gmail.com
 
Posts: n/a

Default dynamic cursors in mysql - 03-30-2007 , 03:20 AM






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 @tab1 = "SELECT test1,test2 FROM testdb.testtable;";
DECLARE curtest CURSOR FOR @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.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.