A new topic, 'Multiple statements in sql tag not working', has been made on a 
board you are watching.

You can see it at
http://liquibase.org/forum/index.php?topic=543.new#new

The text of the topic is shown below:

Hello again,

I'm having trouble using the sql and sqlFile tags where the content has 
multiple SQL statements. The docs say I should be able to use a 'go' delimiter 
between statements - but I'm getting the following error if I try and do this:

Code:
          Caused By: Error executing SQL IF EXISTS
                        (
                                SELECT *
                                FROM sys.objects
                                WHERE object_id = OBJECT_ID(N'[test].[currval]')
                                AND type in (N'FN', N'IF', N'TF', N'FS', N'FT')
                        )
                        DROP FUNCTION [test].[currval]
go
                        IF EXISTS
                        (
                        SELECT *
                        FROM sys.objects
                        WHERE object_id = OBJECT_ID(N'[test].[nextval]')
                        AND type in (N'P', N'PC')
                        )
                        DROP PROCEDURE [test].[nextval]:
          Caused By: Incorrect syntax near 'go'.
        at liquibase.changelog.ChangeSet.execute(ChangeSet.java:279)

As you can see, my sql tag looks as follows:

Code:
                <sql>
                        IF EXISTS
                        (
                                SELECT *
                                FROM sys.objects
                                WHERE object_id = 
OBJECT_ID(N'[${cmuser}].[currval]')
                                AND type in (N'FN', N'IF', N'TF', N'FS', N'FT')
                        )
                        DROP FUNCTION [${cmuser}].[currval]
go                      
                        IF EXISTS
                        (
                        SELECT *
                        FROM sys.objects
                        WHERE object_id = OBJECT_ID(N'[${cmuser}].[nextval]')
                        AND type in (N'P', N'PC')
                        )
                        DROP PROCEDURE [${cmuser}].[nextval]
                </sql>


It works ok if I replace the go with a semi-colon - but this isn't native to 
SQL Server - so I'd prefer to use 'go' as the delimiter.

Any ideas?

Thanks,

Ben

PS - I'm using a 2.0 RC2 build.

Unsubscribe to new topics from this board by clicking here: 
http://liquibase.org/forum/index.php?action=notifyboard;board=1.0

Regards,
The LiquiBase Community Forum Team.
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Liquibase-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/liquibase-user

Reply via email to