Use EXPLAIN only with data returning requests. EXPLAIN returns multiple rows of a single column whose data type is VARCHAR(80). Because it causes multiple rows to be returned, EXPLAIN can only be performed with a cursor.
For static execution of EXPLAIN, see Teradata Vantageā¢ - SQL Stored Procedures and Embedded SQL, B035-1148, substituting an EXPLAIN-modified SQL request for the query_expression clause shown there.
Do not perform EXPLAIN request modifiers dynamically because the result is unpredictable.