Skip to Main Content

SQLcl

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

Export Differences between Triggers via SQLCL

Ajax_ordsFeb 5 2024 — edited Feb 6 2024

Hi Folks,

I am using sqlcl-23.3.0.270.1251 and 19C.

I performed the standard command of exporting the DB objects and it was created as expected.

lb genschema -split.

While trying to upload the objects it errored out for few objects mostly PLSQL oriented like packages and triggers and not for all packages and triggers.

First Triggers

CREATE OR REPLACE EDITIONABLE TRIGGER TEST_PUBLIC_HOLIDAYS_TRIGG" BEFORE INSERT ON TEST_PUBLIC_HOLIDAYS
FOR EACH ROW
BEGIN
IF INSERTING AND :NEW.ID IS NULL
THEN
SELECT TEST_PUBLIC_HOLIDAYS_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL;
END IF;
END;
/
ALTER TRIGGER TEST_PUBLIC_HOLIDAYS_TRIGG" ENABLE

This has a / back slash after the trigger and therefore didn't failed when executing via schema user.

CREATE OR REPLACE EDITIONABLE TRIGGER TEST_EMAILS_LIST_TRG" before
insert ON TEST_EMAILS_LIST for each row
begin
if :new.id is null then
:new.id := TEST_EMAILS_LIST_SEQ.nextval;
end if;
end;
ALTER TRIGGER TEST_EMAILS_LIST_TRG" ENABLE
Where the backslash wasn't created.

Both the scripts were created by Liquibase only and of course I have extracted the SQL from the .XML files.

I am failing to understand the reason why two differenst scripts were generated by tool and how can we ensure the backslash is always populated to avoid getting 4/1 PLS-00103: Encountered the symbol "ALTER"

Comments
Post Details
Added on Feb 5 2024
3 comments
134 views