EXECUTE IMMEDIATE PL/SQL Block return type
<p>As part of a test I want to run a PL/SQL block using <code>EXECUTE IMMEDIATE</code> but when I try to fetch the result with <code>INTO</code> it always returns the same error regardless the content of the PL/SQL block I want to run.</p>

<pre><code>DECLARE
    l_output    VARCHAR2(10);
BEGIN
    EXECUTE IMMEDIATE 'BEGIN COMMIT; END;' INTO l_output;
END;
/
</code></pre>

<p>And the error is</p>

<pre><code>ORA-01007: variable not in select list
</code></pre>

<p>I know this error has to with <code>l_output</code> not being the same type as the returning type by <code>EXECUTE IMMEDIATE</code>, but I don't know the type. I already tried to change <code>l_output</code> to <code>CLOB</code>, <code>BLOB</code>, <code>NUMBER</code> and nothing changes. Any idea?</p>

<p>OK, this is another example, same result.</p>

<pre><code>DECLARE
    l_output    VARCHAR2(10);
BEGIN
    EXECUTE IMMEDIATE 'BEGIN DBMS_OUTPUT.PUT_LINE(''TEST''); END;' INTO l_output;
END;
/
</code></pre>