0

This is MySQL procedure. How can I receive the output into the variable?

this is an analyze statements in a loop. this return many results to the code and I would like to save those results in the log table.

result example : alonpdb.XXX analyze status OK

SET @analyze_stmt = CONCAT('ANALYZE TABLE ', @v_table_name);
PREPARE stmt FROM @analyze_stmt;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
Bar
  • 1
  • 4
  • Are you looking for [*this*](https://stackoverflow.com/a/2609807/5452965) – codtex Jan 02 '19 at 11:26
  • I'm not sure you can do this in mysql alone. Analyze table is a utility statement, not a select, and mysql handles these resultsets differently. You may have to use an external programming language for this. – Shadow Jan 02 '19 at 11:31

0 Answers0