I would like to write a procedure in PL\SQL, which would change the special characters (in the example below: a hash) to a apriori declared characters (in the example below: an underscore). The procedure should take a table name and a column name as parameters. I wrote such a code, however, it doesn't work:
create or replace procedure change_chars(table_name in varchar2, column_name in varchar2)
begin
execute immediate 'update ' || table_name ||
' set ' || column_name || ' = replace(' || column_name ||', '''#''', '''_''')';
end;
Any help would be appreciated
#and_are being interpreted as code rather than as part of the string to execute.