Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting Error while using in Plsql DEFAULT NULL ON CONVERSION ERROR

Rajan SwFeb 12 2021

Have a table called ExternalEventLog and columns as below
CREATE TABLE EXTERNALEVENTLOG
( EXTERNALLOGID NUMBER(10,0) DEFAULT ON NULL ,
FININSTKEY VARCHAR2(32),
APPLNAME VARCHAR2(64),
CONTENT CLOB,
EVENTNAME VARCHAR2(32),
CREATEDBY VARCHAR2(32),
REQUID VARCHAR2(64),
EVENTDATE DATE,
DUID VARCHAR2(32),
STATUS VARCHAR2(32),
CONSTRAINT PK_EXTERNALEVENTLOG PRIMARY KEY (EXTERNALLOGID)
);
if I am using stand alone SQL it is working fine with default null on clause

But the same thing when I am calling from plsql block this is erroring out with
to_date( TO_CHAR(JSON_VALUE(e.content, '$.timestamp')) DEFAULT NULL ON CONVERSION ERROR, 'YYYY-MM-DD HH24:MI:SS') col1,
Error :
ORA-49307 : This argument must be literal or bind variable, however if I remove the DEFAULT NULL ON CONVERSION ERROR this is working fine.

any thoughts how to handle this in PLsql

THanks in advance
I am using 12.2 oracle version

Comments
Post Details
Added on Feb 12 2021
4 comments
2,585 views