I am trying to create function in oracle 12c database using liquibase, below is the sql formatted changelog. I am doing negative testing to see what response i get, purposefully using wrong keyword
--liquibase formatted sql --changeset your.name:1 failOnError:true CREATE OR REPLACE FUNCTION get_tab1_count RETURNS NUMBER AS l_count NUMBER; BEGIN SELECT COUNT(*) INTO l_count FROM person3; RETURN l_count; END; /
This change log gets updated successfully, but as expected in the database I have a function now which has compilation errors,
Compilation errors for FUNCTION GET_TAB1_COUNT Error: PLS-00103: Encountered the symbol "RETURNS" when expecting one of the following: ( return compress compiled wrapped
my question is am i doing something wrong, that liquibase is giving a “update has been successful” message? Or is this expected behaviour? I have tried adding
failOnError:true in the changelog to see if it will actually now fail as there is a compilation error during function creation, but it does not make any difference. I would think that, liquibase would give some sort of failure message when there is a compilation error like the above. Any feedback is much appreciated!