Skip to Main Content

SQLcl

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

23.3: DDL command throws java.lang.NullPointerException at unsupported object type

berxJan 6 2024

this relates to SQLcl 23.3.0.270.1251

While playing with Get started with property graphs in Oracle Database 23c Free – Developer Release, I tried to get the DDL for a PROPERTY graph, but SQLcl threw

java.lang.NullPointerException: Cannot invoke "oracle.dbtools.raptor.query.Query.getSql()" because "query" is null

I understand it's hard for SQLcl to provide the DDL when DBMS_METADATA does not support it in GET_DDLs supported object_type list. (I'm curious how DBMS_DATAPUMP can do this)

my “testcase”:

sql graphuser/graphuser@127.0.0.1/freepdb1

SQLcl: Release 23.3 Production on Sat Jan 06 13:43:58 2024
Copyright (c) 1982, 2024, Oracle.  All rights reserved.
Connected to:
Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release
Version 23.2.0.0.0
SQL> ddl BANK_ACCOUNTS
 CREATE TABLE "GRAPHUSER"."BANK_ACCOUNTS"
   ...   useless lines removed   ...
 TABLESPACE "USERS" ;
SQL> ddl BANK_GRAPH
2024-01-06 13:44:08.495 SEVERE oracle.dbtools.raptor.newscriptrunner.ScriptExecutor run oracle.dbtools.raptor.newscriptrunner.commands.ddl.DbmsMetadataDDLGenerator.getDDL(DbmsMetadataDDLGenerator.java:1206)
java.lang.NullPointerException: Cannot invoke "oracle.dbtools.raptor.query.Query.getSql()" because "query" is null
       at oracle.dbtools.raptor.newscriptrunner.commands.ddl.DbmsMetadataDDLGenerator.getDDL(DbmsMetadataDDLGenerator.java:1206)
       at oracle.dbtools.raptor.newscriptrunner.commands.ddl.DbmsMetadataDDLGenerator.getDDL(DbmsMetadataDDLGenerator.java:998)
       at oracle.dbtools.raptor.newscriptrunner.commands.ddl.DbmsMetadataDDLGenerator.getDDL(DbmsMetadataDDLGenerator.java:981)
       at oracle.dbtools.raptor.newscriptrunner.commands.ddl.DbmsMetadataDDLGenerator.processDDL(DbmsMetadataDDLGenerator.java:949)
       at oracle.dbtools.raptor.newscriptrunner.commands.DDLCommand.handleEvent(DDLCommand.java:159)
       at oracle.dbtools.raptor.newscriptrunner.CommandRegistry.fireListeners(CommandRegistry.java:437)
       at oracle.dbtools.raptor.newscriptrunner.ScriptRunner.run(ScriptRunner.java:241)
       at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:370)
       at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:255)
       at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.processLine(SqlCli.java:1189)
       at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.runSqlcl(SqlCli.java:1370)
       at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.main(SqlCli.java:350)
SQL> select object_type from user_objects where object_name='BANK_GRAPH';
OBJECT_TYPE
_________________
PROPERTY GRAPH
SQL>
SQL> version
Oracle SQLDeveloper Command-Line (SQLcl) version: 23.3.0.0 build: 23.3.0.270.1251
SQL>

hth,
Martin

Comments
Post Details
Added on Jan 6 2024
0 comments
138 views