If you want to execute DDL statement <sql_statement> over DB link <db_link_name> try using this:
DECLARE
t_cursor PLS_INTEGER;
BEGIN
t_cursor := dbms_sql.open_cursor'||db_link_name||';
dbms_sql.parse'||db_link_name||'(t_cursor, '''||sql_statement||''', dbms_sql.NATIVE);
dbms_sql.close_cursor'||db_link_name||'(t_cursor);
END;
This solution is quite tricky and I guess this wouldn't work for every DDL statement but it worked for me in 10g for enabling/disabling constraints and indexes. Another good thing about it is that DBlink name is dynamic and not hard-coded.
does not work.
ReplyDeletecan you post working sample.
dbms_sql.open_cursor'||db_link_name||';
This comment has been removed by the author.
ReplyDelete