# SQL or Oracle Extension

**URL:** <https://forum.liquibase.org/t/sql-or-oracle-extension/2061>\
**Category:** General Discussion\
**Created:** [August 14, 2012, 4:30pm UTC](https://forum.liquibase.org/t/sql-or-oracle-extension/2061 "2012-08-14T16:30:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixelatedpete](https://avatars.discourse-cdn.com/v4/letter/p/a587f6/32.png) [@pixelatedpete](https://forum.liquibase.org/u/pixelatedpete)\
**Post date:** [August 14, 2012, 4:30pm UTC](https://forum.liquibase.org/t/sql-or-oracle-extension/2061/1 "2012-08-14T16:30:00Z")

</div>

Hello!  
  
I’m new to Liquibase so forgive the naive question…  
  
I’m using an Oracle database. That is unlikely to change any time soon. I’m trying to put together some Liquibase changeSets and a number of the tables use things like check constraints, triggers, etc.  
  
Seems there are two ways to manage that using Liquibase. Firstly, I can use the SQL tag and include the Oracle specific SQL. This seems easiest and quickest (the SQL already exists) so that’ll be the course I take I suspect.  
  
However, I appreciate there are benefits from using the Liquibase tags - deploying to a different RDBMS for example - so was wondering if I ought to be considering the Oracle extension instead? Seems to be doing that is pretty much just rewriting the existing SQL - as presumably those extensions do not support alternate RDBMSs so what would I gain by going through that process? Rollback maybe?  
  
Does it matter much if I just wrap a load of existing SQL in Liquibase XML?  
  
Your thoughts would be very welcome!  
  
Thanks in advance.  
  
Pete

---

<div class="post-metadata">

**Author:** ![pixelatedpete](https://avatars.discourse-cdn.com/v4/letter/p/a587f6/32.png) [@pixelatedpete](https://forum.liquibase.org/u/pixelatedpete)\
**Post date:** [August 14, 2012, 4:30pm UTC](https://forum.liquibase.org/t/sql-or-oracle-extension/2061/2 "2012-08-14T16:30:00Z")

</div>

Thanks Andreas - that is both reassuring and helpful!

---

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forum.liquibase.org/u/Guest)\
**Post date:** [August 14, 2012, 4:30pm UTC](https://forum.liquibase.org/t/sql-or-oracle-extension/2061/3 "2012-08-14T16:30:00Z")

</div>

Hi Pete,

yes, the benefit of using the Oracle extension is that, where possible, rollback actions are generated automatically. However, at our organization, we use a mix of Oracle-Tag and hand-written SQL nevertheless because we like our rollbacks to be more precise. An example is this:

… some changelog …

&nbsp; &nbsp; &nbsp; &nbsp; \<ora:dropCheck tableName=“our\_table” constraintName=“some\_constraint\_name” /\>

&nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ALTER TABLE&nbsp; our\_table&nbsp;ADD

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CONSTRAINT some\_constraint\_name

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CHECK ( the\_new\_version\_of\_the\_check\_condition )

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENABLE VALIDATE

&nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \<ora:dropCheck tableName=" our\_table&nbsp;" constraintName=" some\_constraint\_name"/\>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ALTER TABLE&nbsp; our\_table&nbsp;ADD

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CONSTRAINT some\_constraint\_name

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CHECK ( the\_previous\_version\_of\_the condition )

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENABLE VALIDATE;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;

This way, in case of a schema rollback, we will get the exact definition of the previous constraint back. So, our strategy is this:&nbsp;

- Use the Oracle extensions where practical (faster once you have memorized the syntax, also more intuitive to our java developers)

- Use hand-written SQL where you see fit.

So, a mix between Oracle Extensions and hand-written SQL works just fine as far as I am concerned.

Best regards,

Andreas

---

<div class="post-metadata">

**Author:** ![a.buschka](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@a.buschka](https://forum.liquibase.org/u/a.buschka)\
**Post date:** [August 14, 2012, 4:30pm UTC](https://forum.liquibase.org/t/sql-or-oracle-extension/2061/4 "2012-08-14T16:30:00Z")

</div>

You’re welcome, but please keep in mind that I am a Liquibase-beginner, too 🙂 But so far, I can say that it works pretty good in our project. The only feature we are really missing is Liquibase being able to use different connections (=accounts) for different schemas.
