Hi
I'd like to "export" my objects' DDL from one schema and run it in another schema.
I'd like to generate the DDL statements separately, not in a single script (or CLOB), so that when I run them in the new schema I can keep track of the execution of each of them separately and capture potential errors.
Using dbms_metadata.get_ddl I am facing the following problem:
When it generates the DDL for triggers, it would return two statements per trigger (CREATE TRIGGER and ALTER TRIGGER ENABLE ).
In the target schema I'd use execute immediate, and it would fail because it is no able to execute these two statements in this form:
CREATE OR REPLACE EDITIONABLE TRIGGER "FTS_COV_SR_LOG_AUDIT"
before insert or update on FTS_COV_SR_LOG for each row
begin
null ; -- contents is irrelevant...
end;
ALTER TRIGGER "FTS_COV_SR_LOG_AUDIT" ENABLE;
Is there a way to get dbms_metadata to return the trigger creation DDL not including the ALTER TRIGGER statement or basically not return more than one statement per object? So something that execute immediate would be able to execute
thanks in advance for hints!