MySQL Forums
Forum List  »  InnoDB

Fetch data from cursor with unknown fields
Posted by: Glenn Boschmans
Date: March 06, 2008 08:29AM

Hi all,

In a stored procedure I declare a cursor with "Select *" from a table that is given with a parameter of the procedure. Because of that, I don't know how many fields and which fields the cursor will have.
I wonder if there is a possibility to get the value from each field from a row in the cursor, without declaring variables to fetch the value.


To help you understand, here's how I declare the cursor:

Create procedure Test(table_in char(50))

begin

declare cur_table cursor for select * from table_in;

/* do the fetching and the actions */
end



Edited 1 time(s). Last edit at 03/06/2008 08:29AM by Glenn Boschmans.

Options: ReplyQuote


Subject
Views
Written By
Posted
Fetch data from cursor with unknown fields
6399
March 06, 2008 08:29AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.