Extraction Limitations

Restrictions and limitations affect the data extraction facility.

When Temp_Extract_Name1 is set, you cannot perform these operations:
Events do not support execution of statements that return result sets. The server log returns an error similar to:
Handler for event 'test_ev' caused SQLSTATE '09W03'
Result set not permitted in 'test_ev'

To execute a query through an event, create an event that calls a stored procedure and insert the stored procedure results into a temporary table. If extract is used, the temporary table is always empty and requires little overhead.

For example:
CREATE PROCEDURE proc1()
BEGIN
	SET TEMPORARY OPTION temp_extract_name1 = 'testproc.out';
	SELECT * FROM iq_table;
END;

CREATE EVENT "test_ev" ENABLE HANDLER
BEGIN
	SELECT * INTO #tmp FROM proc1();
END;

TRIGGER EVENT test_ev;
Related reference
Data Extraction Option Examples