MySQL Forums
Forum List  »  PHP

Paasing Table name to Query from another Table in stored procedure
Posted by: Manthan Tripathi
Date: January 26, 2013 07:38AM

My application structure is like this,
I have 3 companies and each company has different table.
like for company1's data table name is table1, for company2's data table2.

So i made a table to map company id to its table name.
Now i want to have my table name in Stored procedure And traverse through the result of the executed query.

My problem is:
Cursor can't have dynamic queries.

And I want to do this for several times in stored procedure. And my database tables are large enough.
So i can't use temporary tables or views.
If it is any other way please suggest it.

Options: ReplyQuote

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.