Skip to Main Content

Sqlcl gives an NullPointer Exception on a break

Peter van der SpoelFeb 12 2019 — edited Feb 14 2019

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 99

col status      head 'Description'      for a32

col cnt         head 'Count'            for 999G999G999

compute sum label Total of cnt on report

break on state skip 1 on status on report

ttitle 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(*) cnt

from    composite_instance

group 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 run

SEVERE: oracle.dbtools.db.SQLPLUSCmdFormatter.generateBrkComputeColKeys(SQLPLUSCmdFormatter.java:5680)

java.lang.NullPointerException

at 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 ?

Comments
Post Details
Added on Feb 12 2019
0 comments
185 views