I am creating a stored procedure in MySQL 5.1.40 which needs to run a lot of SQL statements.
One particular statement that is often repeated clears a temp table:
DELETE FROM w_projection_temp WHERE user_id = uid;
The uid variable is an IN parameter for the SP.
Is it possible to assign that entire SQL statement to another variable, and then somehow run (evaluate?) that new variable? eg:
DECLARE clear_temp VARCHAR;
SET clear_temp = 'DELETE FROM w_projection_temp WHERE user_id = uid;'
MTIA