sql-maven-plugin
sql-maven-plugin copied to clipboard
cannot execute 'spool off or spool xxx.log' with sqlCommand
Hi, a problem I meet when I use sqlCommand to execute ''spool off' or ' spool xxx.log', and it returns 'java.sql.SQLSyntaxErrorException: ORA-00900: invalid SQL statement'. what should I do if I want to execute the command 'spool xx' to log something to file, thanks
<executions>
<execution>
<id>spool_log</id>
<phase>initialize</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<sqlCommand>spool InsertTestData.log</sqlCommand>
</configuration>
</execution>
<execution>
<id>reset_data</id>
<phase>initialize</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<srcFiles>
<srcFile>${project.basedir}/src/main/resources/db/reset_data.sql</srcFile>
</srcFiles>
</configuration>
</execution>
</executions>
The spool command is not an sql command, but a command only understood by Oracle's sql*plus and maybe other tools. It's not the database that handles such a command, but it's the tool's job. So I don't think this plugin can help you here.