sql-maven-plugin icon indicating copy to clipboard operation
sql-maven-plugin copied to clipboard

cannot execute 'spool off or spool xxx.log' with sqlCommand

Open desertTown opened this issue 6 years ago • 1 comments

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>

desertTown avatar Aug 07 '18 05:08 desertTown

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.

dstango avatar Aug 22 '23 20:08 dstango