1

in mysql I have two stored procedure sp1 and sp2.
sp2 creates a temp table called temp_tbl.
sp1 calls sp2 and uses temp_tbl multiple times in procedure. But when I run, I get error Can't reopen table: 'temp_tbl'!
I tried to call sp2 before each select, but again the same error occurred.
Also using different aliases for temp table didn't solved the problem.
Any solution to handle this?

  • Please have a look on [this answer](https://stackoverflow.com/a/26041595/7564182), sounds like the syntax you are searching for. – Myonara Aug 07 '17 at 04:40
  • tnx @Myonara, but the answer you mentioned is in sql server syntax. In mysql, table name can not pass through param. – user2685815 Aug 07 '17 at 05:10

0 Answers0