"Use Database" command inside a stored procedure
From MySQL Documentation on Stored Routine Syntax  When the routine is invoked, an implicit USE db_name is performed (and undone when the routine terminates).
USE statements within stored routines are not permitted
If you need to query tables from other databases you can do it like DBName.TableName. and you can change DBName dynamically.