# Creating function using liquibase sql changelog is successful but function has compilation warning

**URL:** <https://forum.liquibase.org/t/creating-function-using-liquibase-sql-changelog-is-successful-but-function-has-compilation-warning/4275>\
**Category:** General Discussion\
**Created:** [June 9, 2020, 1:37am UTC](https://forum.liquibase.org/t/creating-function-using-liquibase-sql-changelog-is-successful-but-function-has-compilation-warning/4275 "2020-06-09T01:37:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubenr](https://avatars.discourse-cdn.com/v4/letter/r/898d66/32.png) [@rubenr](https://forum.liquibase.org/u/rubenr)\
**Post date:** [June 9, 2020, 1:37am UTC](https://forum.liquibase.org/t/creating-function-using-liquibase-sql-changelog-is-successful-but-function-has-compilation-warning/4275/1 "2020-06-09T01:37:27Z")

</div>

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 `returns`

```auto
--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,

```auto
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!

---

<div class="post-metadata">

**Author:** ![Pete](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/pete/32/184_2.png) [@Pete](https://forum.liquibase.org/u/Pete)\
**Post date:** [June 22, 2020, 1:25pm UTC](https://forum.liquibase.org/t/creating-function-using-liquibase-sql-changelog-is-successful-but-function-has-compilation-warning/4275/2 "2020-06-22T13:25:38Z")

</div>

This is expected behavior. The same thing would happen if you ran the SQL script outside of Liquibase as well: the object would be created but fail to compile. In both instances you have to take additional steps to confirm that the object is valid.
