I'd like to update a table in dynamic sql.
declare
x varchar2(10) := 'table_n';
begin
execute immediate 'update :1 set column_n = 12345' using x;
end;
I get ORA-00903: invalid table name
But
declare
x varchar2(10) := 'table_n';
begin
execute immediate 'update ' || x || ' set column_n = 12345';
end;
Works.
What's wrong with the first solution?