Suppose I've got a database data1 which provides me this:

show tables


table1

table2

table3


Now rather than individually performing "choose * from each table" i wish to produce a procedure which matches through each database proven in "show databases" resultset, after which executes choose * from each table of this database. I figured of utilizing cursors which may scroll lower the resultset, hold each database title inside a variable after which execute choose statement on each table of this database crossing in the same manner. Can someone kindly assist me with using cursors within this situation, like me only conscious of using cursors for Choose increase claims.

btw i personally use MYSQL.

you will get the query from infromation_Schema rather than 'show datbases'