This content has been marked as final. Show 2 replies
Oh, never mind. I've found the reason --- you can't use binds to assign table or columns names. Binding is to assign values to variables, to avoid converting something to varchar2. If the thing has no type in the sql statment then it is not for binding.
You cannot bind Table/Column Names using the Bind Variables (USING) clause.
You will have to append them to the Dynamic SQL.
Something this way:
For more information on Execute Immediate, please read Execute Immediate Statement.
declare update_statement Varchar2(2000); v_table_name varchar2(30); begin v_table_name = 'GR_TEST'; update_statement := ' update ' || v_table_name || ' set n = 2'; execute immediate update_statement; end;
For Dynamic SQL, read Dynamic SQL Oracle 11g.