Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Hansjörg.

Asked: April 15, 2016 - 7:35 am UTC

Last updated: October 18, 2017 - 4:43 am UTC

Version: sqlcl-4.2.0.16.049.0843-no-jre

Viewed 1000+ times

You Asked

Hi I am using sqlcl quite a while and constantly get this null pointer exception.

Any Idea

Apr 15, 2016 9:28:22 AM oracle.dbtools.plusplus.JDBCHelper getOH
WARNING: oracle.dbtools.plusplus.JDBCHelper.getOH(JDBCHelper.java:83)
java.lang.NullPointerException
at oracle.dbtools.plusplus.JDBCHelper.getOH(JDBCHelper.java:83)
at oracle.dbtools.plusplus.JDBCHelper.isOHReal(JDBCHelper.java:58)
at oracle.dbtools.plusplus.JDBCHelper.doesOHJDBCExist(JDBCHelper.java:108)
at oracle.dbtools.raptor.scriptrunner.cmdline.SQLCliOptions.populateContextWithOptions(SQLCliOptions.java:755)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.processArgs(SqlCli.java:212)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.main(SqlCli.java:326)

SQLCL Version : Feb 18, 2016

Best
Hansjörg


as you see its a warning...
- sqlcl starts normally ...
- I am starting sqlcl from Windows powershell commandline (win10)

$std_args="-Djava.awt.headless=true -Xss10M"
$debug=""
$cpfile = $sql_home + "\lib\oracle.sqldeveloper.sqlcl.jar"

java $std_args $debug -cp $cpfile oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli $connect


and Chris said...

I reached out to Jeff Smith who had this to say:

"It’s where we’re looking for the Oracle Home in the registry. It’s fixed for the next update.

In simpler terms, nothing to worry about, we’re just showing internal warnings that we shouldn’t be."

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

SQLTERMINATOR in SQLCL 17.3

Rajeshwaran Jeyabal, October 17, 2017 - 7:07 am UTC

Team:

I am SQLCL 17.3 connecting to Oracle 11g database.

demo@ORA11G> create table t(aa xmltype,bb varchar2(100),c date);

Table T created.

demo@ORA11G> show ddl
STORAGE : ON
INHERIT : ON
SQLTERMINATOR : ON
OID : ON
SPECIFICATION : ON
TABLESPACE : ON
SIZE_BYTE_KEYWORD : ON
PRETTY : ON
REF_CONSTRAINTS : ON
FORCE : ON
PARTITIONING : ON
CONSTRAINTS : ON
INSERT : ON
BODY : ON
CONSTRAINTS_AS_ALTER : ON
SEGMENT_ATTRIBUTES : ON
demo@ORA11G> drop table t purge;

Table T dropped.

demo@ORA11G> create table t(aa xmltype,bb varchar2(100),c date);

Table T created.

demo@ORA11G> show ddl
STORAGE : ON
INHERIT : ON
SQLTERMINATOR : ON
OID : ON
SPECIFICATION : ON
TABLESPACE : ON
SIZE_BYTE_KEYWORD : ON
PRETTY : ON
REF_CONSTRAINTS : ON
FORCE : ON
PARTITIONING : ON
CONSTRAINTS : ON
INSERT : ON
BODY : ON
CONSTRAINTS_AS_ALTER : ON
SEGMENT_ATTRIBUTES : ON
demo@ORA11G> set ddl specification off
DDL Option SPECIFICATION off
demo@ORA11G> set ddl storage off
DDL Option STORAGE off
demo@ORA11G> set ddl segment_attributes off
DDL Option SEGMENT_ATTRIBUTES off
demo@ORA11G> select dbms_metadata.get_ddl('TABLE','T') from dual;

DBMS_METADATA.GET_DDL('TABLE','T')
--------------------------------------------------------------------------------

  CREATE TABLE "DEMO"."T"
   (    "AA" "XMLTYPE",
        "BB" VARCHAR2(100),
        "C" DATE
   )



you can see the SQL Terminator is missing in the above output, though we have set SQLTERMINATOR to ON (by default).

If we set SQLTERMINATOR to ON explicitly again, we could see the SQL Terminator in the output. Kindly advice.

  
demo@ORA11G> show ddl
STORAGE : OFF
INHERIT : ON
SQLTERMINATOR : ON
OID : ON
SPECIFICATION : OFF
TABLESPACE : ON
SIZE_BYTE_KEYWORD : ON
PRETTY : ON
REF_CONSTRAINTS : ON
FORCE : ON
PARTITIONING : ON
CONSTRAINTS : ON
INSERT : ON
BODY : ON
CONSTRAINTS_AS_ALTER : ON
SEGMENT_ATTRIBUTES : OFF
demo@ORA11G> set ddl sqlterminator on
DDL Option SQLTERMINATOR on
demo@ORA11G> select dbms_metadata.get_ddl('TABLE','T') from dual;

DBMS_METADATA.GET_DDL('TABLE','T')
--------------------------------------------------------------------------------

  CREATE TABLE "DEMO"."T"
   (    "AA" "XMLTYPE",
        "BB" VARCHAR2(100),
        "C" DATE
   ) ;



demo@ORA11G>


Script used for this demo:
drop table t purge;
create table t(aa xmltype,bb varchar2(100),c date);
show ddl
set ddl specification off
set ddl storage off
set ddl segment_attributes off
select dbms_metadata.get_ddl('TABLE','T') from dual;
show ddl 
set ddl sqlterminator on 
select dbms_metadata.get_ddl('TABLE','T') from dual;

Connor McDonald
October 18, 2017 - 4:43 am UTC

sqlterminator is about the terminator to be used in SQLcl the *tool*, just like it is i sqlplus.

It is *unrelated* to the concept of "do I want to add a sqlterminator to the DDL I generate" which is "ddl sqlterminator".

Hope this helps.