execute immediate
has an into
clause even though it does not execute a select
statement. So, the error ORA-01007: Reference to a variable not in SELECT clause is thrown: create table tq84_t (a number); -- ORA-01007: variable not in select list declare x number; begin execute immediate 'insert into tq84_t values(:1)' into x using 42; end; / drop table tq84_t;