Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 1169

Sybase - createProcedure does not work

$
0
0
Hi all,

We are using Liquibase 3.5.3 with Maven 3.3.0 and Eclipse 4.5.2.  Everything works and we can successfully run a Liquibase build with maven to our Sybase databases.

However, for whatever reason, we can not get the createProcedure to work in a <changeSet>.  Does anyone have a working template of createProcedure against a Sybase database?

We can get the procedure to create by using just simple <sql> elements : The following does work...

  1.     <changeSet author="adym.lincoln@..." id="lbTestLiquibase-1.0.0">
  2.         <sql>
  3.             use our_db 
  4.         </sql>
  5.         <sql>
  6.             if exists(select * from sysobjects where name = 'lbTestLiquibase' and type = 'P') drop procedure lbTestLiquibase
  7.         </sql>

  8.         <sql splitStatements="true" endDelimiter=";" stripComments="false"><![CDATA[
  9. if exists(select * from sysobjects where name = 'lbTestLiquibase' and type = 'P') drop procedure lbTestLiquibase 
  10. ;

  11. CREATE PROCEDURE dbo.lbTestLiquibase
  12. as
  13. BEGIN

  14.     declare @status int
  15.     declare @message varchar(255)
  16.     declare @error int
  17.     
  18.     select 'Version [1.0.1]' as version
  19.     return 0

  20. Error_Exit:
  21.     select @message
  22.     return @status

  23. END
  24. ;
  25. ]]>
  26.         </sql>


The following does NOT work : 


  1.     <changeSet author="adym.lincoln@libertymutual.com" id="lbTestLiquibase-1.0.0">
  2.         <sql>
  3.             use our_db 
  4.         </sql>
  5.         <sql>
  6.             if exists(select * from sysobjects where name = 'lbTestLiquibase' and type = 'P') drop procedure lbTestLiquibase
  7.         </sql>


  8.         <createProcedure 
  9.             dbms="Sybase" 
  10.             encoding="utf8" 
  11.             procedureName="lbTestLiquibase" 
  12.             relativeToChangelogFile="true">
  13. CREATE PROCEDURE dbo.lbTestLiquibase
  14. as
  15. BEGIN

  16.     declare @status int
  17.     declare @message varchar(255)
  18.     declare @error int
  19.     
  20.     select 'Version [1.0.0]' as version
  21.     return 0

  22. Error_Exit:
  23.     select @message
  24.     return @status

  25. END
  26.         </createProcedure>
  27.     </changeSet>

Things I've tried : 

- Adding catalogName and schemaName to the createProcedure...

  1.         <createProcedure 
  2.             dbms="Sybase" 
  3.             encoding="utf8" 
  4.             procedureName="lbTestLiquibase" 
  5.             relativeToChangelogFile="true" 
  6.             schemaName="dbo">

  7.         <createProcedure 
  8.             catalogName="our_db"
  9.             dbms="Sybase" 
  10.             encoding="utf8" 
  11.             procedureName="lbTestLiquibase" 
  12.             relativeToChangelogFile="true" 
  13.             schemaName="dbo">


tia,

adym



Viewing all articles
Browse latest Browse all 1169

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>