I’m running into an issue when creating a view via Liquibase where a simple division (/) inside the SELECT list causes the statement to break.
Minimal example view (simplified):
create or replace view some_view_v as
select b.some_column,
-- completion %
case
when b.total_cnt = 0 then 100
else round(b.approved_cnt * 100 / b.total_cnt, 1 )
end as completion_pct,
b.another_column
from some_table b
/
Changelog (also simplified):
<changeSet id="1" author="x" runOnChange="true">
<sqlFile
path="some_view_v.sql"
relativeToChangelogFile="true"
endDelimiter="\n/"
splitStatements="false" />
</changeSet>
Error:
Liquibase executes only part of the SELECT and fails with:
select b.some_column,
-- completion %
case
when b.total_cnt = 0 then 100
else round(b.approved_cnt * 100 / b.total_cnt, 1 )
end as completion_pct,
Error report -
ORA-00936: missing expression
https://docs.oracle.com/error-help/db/ora-00936/
00936. 00000 - "missing expression"
*Cause: A required part of a clause or expression has been
omitted. For example, a SELECT statement may have been entered
without a list of columns or expressions or with an incomplete
expression. This message was also issued in cases where a
reserved word was misused, as in SELECT TABLE.
*Action: Check the statement syntax and specify the missing
component.
The statement is clearly truncated after
end as completion_pct,
Key observations
- The SQL works perfectly when executed directly (SQLcl / VS Code)
- The issue only occurs when executed via Liquibase (lb)
- If I replace / with + or *, the changeset works
- Any occurrence of / inside the SELECT list triggers the issue
- Rewriting the expression (parentheses, NULLIF, subqueries, etc.) does not help
- Changing endDelimiter (/, \n/, custom values, or none) does not help
- splitStatements="false" is already set
Environment
- Liquibase version: 4.33.0 #8744 built at 2025-07-08 20:43+0000
- Extension Version: 25.4.2.0
I also tried a standalone version of SQLcl (normally we use VS Code); same problem there.
Question
Has anyone seen Liquibase (or SQLcl integration) treat / inside a SQL expression as a statement delimiter?
Is there a reliable way to prevent this behaviour?
Edit
I ran another test using:
lb update-sql -chf _root_controller.xml -ouf install_1.3.0.sql
Liquibase generates the SQL script correctly, including the division.
When I execute that generated script manually, it runs without any issues.
This seems to indicate that:
- Liquibase generates valid SQL
- but the execution via `lb update` breaks the statement
So the issue appears to be in how the SQL is executed/parsing during deployment, not in the SQL itself.