Forum Stats

  • 3,758,216 Users
  • 2,251,355 Discussions
  • 7,870,114 Comments

Discussions

oracle.dbtools.app.Format.format(Format.java:429) caused by null when formating SQLs with long funct

User800507-Oracle
User800507-Oracle Member Posts: 28 Employee

SQLcl: Release 18.4.0.0 Production

If we format any SQL that contains a long function call (from left to right brecket) after SELECT with the following prefernces

=======

<options>

<maxCharLineSize>100</maxCharLineSize>

<breaksAfterSelect>false</breaksAfterSelect>

</options>

=======

we got

=======

oracle.dbtools.raptor.newscriptrunner.commands.FormatSQLPlusCommand inputFileToOutputFile

SEVERE: oracle.dbtools.app.Format.format(Format.java:429) caused by null at oracle.dbtools.app.Format.format(Format.java:429)

java.lang.NullPointerException

at oracle.dbtools.app.Format.format(Format.java:429)

at oracle.dbtools.raptor.newscriptrunner.commands.FormatSQLPlusCommand.inputFileToOutputFile(FormatSQLPlusCommand.java:327)

at oracle.dbtools.raptor.newscriptrunner.commands.FormatSQLPlusCommand.doWork(FormatSQLPlusCommand.java:202)

at oracle.dbtools.raptor.newscriptrunner.commands.FormatSQLPlusCommand.handleEvent(FormatSQLPlusCommand.java:145)

at oracle.dbtools.raptor.newscriptrunner.CommandRegistry.fireListeners(CommandRegistry.java:430)

at oracle.dbtools.raptor.newscriptrunner.ScriptRunner.run(ScriptRunner.java:224)

at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:344)

at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:227)

at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.process(SqlCli.java:404)

at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.processLine(SqlCli.java:415)

at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.startSQLPlus(SqlCli.java:1139)

at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.main(SqlCli.java:491)

=========

The test SQL is

select dbms_sqltune.report_sql_monitor_list(sql_id=>:1 , session_id=>:2 , session_serial=>:3 ,  active_since_sec=>:4 , inst_id=>:5 , last_refresh_time=>to_date(:6 , 'MM/DD/YYYY hh24.mi.ss'), report_level=>'basic', type=>'XML') from dual

If we increase maxCharLineSize to 300 or set breaksAfterSelect to true we have no erros.