Skip to Main Content

SQLcl

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

liquibase in SQLcl (23.3): lb did'nt take stored procedures into account

RadishOct 30 2023 — edited Nov 13 2023

Dear community,

i'm using Oracle SQLcl (version 23.3) build-in liquibase.
Contrary to the documentation (online and bulid-in) Oracle SQLcl built-in liquibase commands 'diff' and 'diff-changeLog' do not takes stored procedures into account with and without using parameter -diff-types storedprocedures while stored procedures are present in source db and partly in target db.

Setup:

SQLcl: RELEASE=23.3.0.270.1251 JULIAN_BUILD_VERSION=23.3.0.270.1251 LATEST_BUILD=sqlcl-23.3.0.270.1251-2023-09-2712:51:35+0000
Liquibase Version: 4.18.0 #5864 built at 2022-12-02 18:02+0000
Extension Version: 23.3.0.0/23.1.37-000100
Database: Oracle Database 19c Enterprise Edition Version 19.18.0.0.0 (Multitenant)

At source db

CREATE TABLE MYTAB
( ID NUMBER
);

create or replace function foo
return boolean
AS
begin
return true;
end foo;

create or replace procedure bar
As
begin
if foo then null; else null; end if;
end bar;

create or replace package mypackage
as
n constant number := 4;
end;

Check objects in source db

select * from user_objects;

OBJECT_NAME OBJECT_TYPE
----------- -----------
FOO FUNCTION
MYTAB TABLE
BAR PROCEDURE
MYPACKAGE PACKAGE

At target db:

create or replace procedure bar
As
begin
null;
end bar;

Check objects in target db

select * from user_objects;

OBJECT_NAME OBJECT_TYPE
----------- -----------
BAR PROCEDURE

Actions:

Logon to source db:

"C:\***\sqlcl\bin\sql.exe" -L ***/***@//***:***/source_db

Run liquibase:

lb diff-changelog -reference-url jdbc:oracle:thin:@//***:***/target_db -reference-username *** -reference-password *** -dit storedprocedures

returns:

<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"/>

==> No stored procedure mentioned at all.

Is this a documentation error, a bug or are there any other reasons for thist unexpected behaviour?

Kindly regards!

Comments
Post Details
Added on Oct 30 2023
2 comments
372 views