[ 
http://jira.codehaus.org/browse/MSQL-21?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=149525#action_149525
 ] 

John Newman commented on MSQL-21:
---------------------------------

Thanks Dan,

Well, you're right.  At first I had block mode disabled but it was failing 
anyway.

Why?  The delimiter is case sensitive.

I disabled block mode, went through my scripts and changed all instances of 
"go" to read "GO" and it works!   So close this as not a bug, but maybe add 
that gotcha to the docs and also delimiterType is not documented in the config 
params.

Thanks for all of your hard work on this thing, very useful plugin.

> Can't execute a create stored proc script on MS SQL
> ---------------------------------------------------
>
>                 Key: MSQL-21
>                 URL: http://jira.codehaus.org/browse/MSQL-21
>             Project: Maven 2.x SQL Plugin
>          Issue Type: Bug
>    Affects Versions: 1.2
>            Reporter: John Newman
>
> Hi,
> I'm using the 1.2-SNAPSHOT version and I keep getting syntax errors with 
> these SQL Server 2005 scripts.  It doesn't like the GO keyword despite my 
> settings.
> Here's my config:
>                       <plugin>
>                               <groupId>org.codehaus.mojo</groupId>
>                               <artifactId>sql-maven-plugin</artifactId>
>                               <version>1.2-SNAPSHOT</version>
>                               <dependencies>
>                                       <dependency>
>                                               
> <groupId>net.sourceforge.jtds</groupId>
>                                               <artifactId>jtds</artifactId>
>                                               <version>1.2.2</version>
>                                       </dependency>
>                               </dependencies>
>                               <configuration>
>                                       <username>...</username>
>                                       <password>...password>
>                                       <url>...</url>
>                                       <driver>net.sourceforge.jtds.jdbc.Driver
>                                       </driver>
>                               </configuration>
>                               <executions>
>                                       <execution>
>                                               <id>preparedb</id>
>                                               
> <phase>process-test-resources</phase>
>                                               <goals>
>                                                       <goal>execute</goal>
>                                               </goals>
>                                               <configuration>
>                                                       
> <delimiter>GO</delimiter>
>                                                       
> <delimiterType>row</delimiterType>
>                                                       
> <enableBlockMode>true</enableBlockMode>
>                                                       
> <keepFormat>true</keepFormat>
>                                                       
> <orderFile>ascending</orderFile>
>                                                       <fileset>
>                                                               
> <basedir>src/main/sql</basedir>
>                                                               <includes>
>                                                                       
> <include>**/*.sql</include>
>                                                               </includes>
>                                                       </fileset>
>                                               </configuration>
>                                       </execution>
>                               </executions>
>                       </plugin>
> and mvn -X confirms:
> [DEBUG] Configuring mojo 
> 'org.codehaus.mojo:sql-maven-plugin:1.2-SNAPSHOT:execute' -->
> [DEBUG]   (f) autocommit = false
> [DEBUG]   (s) delimiter = GO
> [DEBUG]   (s) delimiterType = row
> [DEBUG]   (s) driver = net.sourceforge.jtds.jdbc.Driver
> [DEBUG]   (s) enableBlockMode = true
> [DEBUG]   (s) basedir = c:\projects\...\src\main\sql
> [DEBUG]   (s) includes = [Ljava.lang.String;@bac9b9
> [DEBUG]   (f) fileset = [EMAIL PROTECTED]
> [DEBUG]   (s) keepFormat = true
> [DEBUG]   (s) onError = abort
> [DEBUG]   (s) orderFile = ascending
> [DEBUG]   (s) password = ...
> [DEBUG]   (f) settings = [EMAIL PROTECTED]
> [DEBUG]   (f) skip = false
> [DEBUG]   (f) skipOnConnectionError = false
> [DEBUG]   (s) url = jdbc:jtds:sqlserver://localhost/...
> [DEBUG]   (s) username = ...
> [DEBUG] -- end configuration --
> [INFO] [sql:execute {execution: preparedb}]
> [DEBUG] connecting to jdbc:jtds:sqlserver://localhost/...
> [DEBUG] Committing transaction
> [INFO] Executing file: c:\projects\...\src\main\sql\prc_Test.sql
> Here's an example of one of the scripts that are failing:
> src/main/sql/prc_Test.sql:
> set ANSI_NULLS ON
> set QUOTED_IDENTIFIER ON
> GO
> if exists (
>       select * from dbo.sysobjects
>               where id = object_id(N'[dbo].[prc_Test]') 
>                       and OBJECTPROPERTY(id, N'IsProcedure') = 1)  
>       drop procedure [dbo].[prc_Test]
> GO
> CREATE procedure [dbo].[prc_Test]
> AS
> BEGIN
>       SET NOCOUNT ON;
>        SELECT 1
> END
> Then it just says:
> [ERROR] BUILD ERROR
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Incorrect syntax near 'GO'.
> [INFO] 
> ------------------------------------------------------------------------
> [DEBUG] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Incorrect syntax near 
> 'GO'.
> Any ideas?  is this a bug or just not supported?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to