Click here to get back home

dynamic cursors in mysql

 HomeNewsGroups | Search | About
 mailing.database.mysql    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
dynamic cursors in mysql dbkarthik 03-30-2007
Get Chitika Premium
Posted by dbkarthik on March 30, 2007, 4:18 am
Please log in for more thread options
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.


Similar ThreadsPosted
MySQL dynamic table name within query May 16, 2006, 12:27 pm
Dynamic web list question August 9, 2005, 3:31 pm
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' January 12, 2006, 9:26 pm
Problem with accent Import to MySQL/Linux from MySQL Windows September 4, 2005, 1:54 am
MySQL variables, modifying Microsoft SQL sequence insert for use in mysql October 7, 2005, 10:54 am
I want to make transfer data between MySQL Server to MySQL Local . February 9, 2006, 1:25 am
restoring a 4.0.17 mysql server without a mysql dump file July 20, 2005, 12:12 pm
slow mysql "sending data" stage between mysql and php November 29, 2006, 12:23 pm
How to detect if a MySQL db table exists in MySQL 4.1+ March 16, 2006, 3:49 pm
Different results in mysql & mysql query browser? April 18, 2006, 9:05 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap