Skip to Main Content

SQLcl: MCP Server & SQL Prompt

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!

How catch ORA-error in javascript?

User524645-OracleMay 23 2016 — edited Jun 8 2016

Hi!

I would like catch Oracle Db errors in my SQLcl script (wrote on JavaScript).

How I can make this?

Example:

script 

var v_xBinds = {};

if (util.execute("begin pl/sql syntax error here.  'end;',  v_xBinds)) { print(' Done.'); } else {   print('ERROR:'); }   }

/

Execution on wrong PL/SQL anonymouse block not raise any exception. How know ORA-error in script?

Thanx!

Comments
Post Details
Added on May 23 2016
6 comments
1,738 views