Note that there are some explanatory texts on larger screens.

plurals
  1. POMaven: PL/SQL script with sql-maven-plugin throws error PLS-00103
    text
    copied!<p>I'm trying to use the sql-maven-plugin to execute a PL/SQL script on an Oracle 11 database. Although the script is valid PL/SQL (as far as I can tell), the execution gives me a PLS-00103 error: </p> <p>The SQL script: (drop_all_tables.sql)</p> <pre><code>BEGIN EXECUTE IMMEDIATE 'DROP TABLE MY_TABLE'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -942 THEN RAISE; END IF; END; </code></pre> <p>And my plugin configuration:</p> <pre><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;oracle&lt;/groupId&gt; &lt;artifactId&gt;jdbc&lt;/artifactId&gt; &lt;version&gt;11.2.0.2.0&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;create-schema&lt;/id&gt; &lt;phase&gt;process-test-resources&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;execute&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;driver&gt;oracle.jdbc.driver.OracleDriver&lt;/driver&gt; &lt;url&gt;${jdbc.url}&lt;/url&gt; &lt;username&gt;${jdbc.username}&lt;/username&gt; &lt;password&gt;${jdbc.password}&lt;/password&gt; &lt;autocommit&gt;true&lt;/autocommit&gt; &lt;srcFiles&gt; &lt;srcFile&gt;src/main/resources/sql/drop_all_tables.sql&lt;/srcFile&gt; &lt;/srcFiles&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre> <p>And this is the output from the Maven execution:</p> <pre><code>[ERROR] Failed to execute: BEGIN EXECUTE IMMEDIATE 'DROP TABLE MY_TABLE'; [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] ORA-06550: line 2, column 43: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: ( begin case declare end exception exit for goto if loop mod null pragma raise return select update while with &lt;an identifier&gt; &lt;a double-quoted delimited-identifier&gt; &lt;a bind variable&gt; &lt;&lt; continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge </code></pre>
 

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