Forum Stats

  • 3,758,923 Users
  • 2,251,475 Discussions
  • 7,870,436 Comments

Discussions

Sqlcl gives an NullPointer Exception on a break

Peter van der Spoel
Peter van der Spoel Member Posts: 1
edited Feb 14, 2019 7:02AM in SQLcl

Hi,

I'm getting a NullPointer Exception when running the following query in Sqlcl 18.4:

col datum       head 'Date'col state       head 'State'            for 99col status      head 'Description'      for a32col cnt         head 'Count'            for 999G999G999compute sum label Total of cnt on reportbreak on state skip 1 on status on reportttitle left 'Number of ECIDs by state' skip left ==================================select  state,       (case   when state = 0 then 'Running'                when state = 1 then 'Completed'                when state = 2 then 'Running with faults'                when state = 3 then 'Completed with faults'                when state = 4 then 'Running with recovery required'                when state = 5 then 'Completed with recovery required'        else                state || ''        end) as status,       trunc (created_time) datum,       count(*) cntfrom    composite_instancegroup by state, trunc(created_time)order by state, datum;

This is the stack trace I'm getting:

Feb 12, 2019 10:42:55 AM oracle.dbtools.raptor.newscriptrunner.ScriptExecutor runSEVERE: oracle.dbtools.db.SQLPLUSCmdFormatter.generateBrkComputeColKeys(SQLPLUSCmdFormatter.java:5680)java.lang.NullPointerExceptionat oracle.dbtools.db.SQLPLUSCmdFormatter.generateBrkComputeColKeys(SQLPLUSCmdFormatter.java:5680)at oracle.dbtools.db.SQLPLUSCmdFormatter.rset2sqlplus(SQLPLUSCmdFormatter.java:866)at oracle.dbtools.db.ResultSetFormatter.rset2sqlplus(ResultSetFormatter.java:328)at oracle.dbtools.db.ResultSetFormatter.rset2sqlplus(ResultSetFormatter.java:302)at oracle.dbtools.db.ResultSetFormatter.formatResults(ResultSetFormatter.java:147)at oracle.dbtools.db.ResultSetFormatter.formatResults(ResultSetFormatter.java:70)at oracle.dbtools.raptor.newscriptrunner.SQL.processResultSet(SQL.java:798)at oracle.dbtools.raptor.newscriptrunner.SQL.executeQuery(SQL.java:709)at oracle.dbtools.raptor.newscriptrunner.SQL.run(SQL.java:83)at oracle.dbtools.raptor.newscriptrunner.ScriptRunner.runSQL(ScriptRunner.java:404)at oracle.dbtools.raptor.newscriptrunner.ScriptRunner.run(ScriptRunner.java:230)at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:344)at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:227)at oracle.dbtools.raptor.newscriptrunner.SQLPLUS.runExecuteFile(SQLPLUS.java:3900)at oracle.dbtools.raptor.newscriptrunner.SQLPLUS.run(SQLPLUS.java:209)at oracle.dbtools.raptor.newscriptrunner.ScriptRunner.runSQLPLUS(ScriptRunner.java:420)at oracle.dbtools.raptor.newscriptrunner.ScriptRunner.run(ScriptRunner.java:257)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:1096)at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.main(SqlCli.java:491)

When I change the break command to:

     break on status skip 1 on report

the query runs fine, but that is not what I want ;-)

Sounds like a bug in the parser  where the break on 'state' is causing Sqlcl to throw the stack trace. How would one go about reporting this to the Sqlcl team ?