Note that there are some explanatory texts on larger screens.

plurals
  1. POsql-maven-plugin with multiple delimiters
    primarykey
    data
    text
    <p>I am using the sql-maven-plugin to execute some MySQL scripts on several databases. I would like to deploy, in the same SQL script, tables, datas, triggers, events and stored procedures.</p> <p>I have a problem with the line delimiter, because for INSERT or CREATE I use the <code>;</code>, but for my triggers I have to change the delimiter with <code>DELIMITER //</code>, for example.</p> <p>I know that the plugin allows changing the delimiter, but it will be applicable for all the script, I want to change the delimiter only for a part of a unique script.</p> <p>This is my maven configuration:</p> <pre class="lang-xml prettyprint-override"><code>&lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;sql-maven-plugin&lt;/artifactId&gt; &lt;version&gt;1.5&lt;/version&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;mysql&lt;/groupId&gt; &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt; &lt;version&gt;5.1.21&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;configuration&gt; &lt;driver&gt;com.mysql.jdbc.Driver&lt;/driver&gt; &lt;username&gt;${db.user}&lt;/username&gt; &lt;password&gt;${db.passwd}&lt;/password&gt; &lt;encoding&gt;UTF-8&lt;/encoding&gt; &lt;orderFile&gt;ascending&lt;/orderFile&gt; &lt;keepFormat&gt;true&lt;/keepFormat&gt; &lt;driverProperties&gt;characterEncoding=utf8, connectionCollation=utf8_general_ci, sql_mode=STRICT_TRANS_TABLES&lt;/driverProperties&gt; &lt;/configuration&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;execution-mysql&lt;/id&gt; &lt;phase&gt;prepare-package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;execute&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;url&gt;jdbc:mysql://${db.url}:${db.port}&lt;/url &lt;delimiterType&gt;normal&lt;/delimiterType&gt; &lt;fileset&gt; &lt;basedir&gt;${project.build.directory}/sql/&lt;/basedir&gt; &lt;includes&gt; &lt;include&gt;${file.sql}&lt;/include&gt; &lt;/includes&gt; &lt;/fileset&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload