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

CKPT
Use



select dbms_lob.getlength(column_name) from table_name;
poorna
Hi CKPT,

Thanks for your quick replay . Here i don't want the length of the column i want size of the table.

Regards,
Poorna Prasad.S
NC
Hi,

Check this article

[url http://www.dba-oracle.com/t_finding_lob_blob_clob_length.htm]

Regards,
NC

Edited by: NC on Jan 16, 2012 11:43 AM
Helios-GunesEROL
Hi;

Please see:

How to Compute the Size of a Table containing Outline CLOBs and BLOBs [ID 118531.1]

Regard
Helios
poorna
Hi Helios,

Thanks for your replay. But when i use the query that meta link id i am getting multiple segment_name why it is like that and also to find the size of my table also it displays multiple records.
    select bytes, s.segment_name,s.segment_type
    from dba_segments s
    where s.segment_name='FAX_MGMT';

65536	FAX_MGMT	TABLE
65536	FAX_MGMT	TABLE
65536	FAX_MGMT	TABLE
196608	FAX_MGMT	TABLE
393216	FAX_MGMT	TABLE
393216	FAX_MGMT	TABLE
7340032	FAX_MGMT	TABLE
select sum(bytes), s.segment_name, s.segment_type
    from dba_lobs l, dba_segments s
    where s.segment_type = 'LOBSEGMENT'
    and l.table_name = 'FAX_MGMT'
    and s.segment_name = l.segment_name
    group by s.segment_name,s.segment_type;

2097152	          SYS_LOB0000076179C00007$$	LOBSEGMENT
65536	          SYS_LOB0000137128C00007$$	LOBSEGMENT
18874368	 SYS_LOB0000108312C00007$$	LOBSEGMENT
4032823296	SYS_LOB0000153767C00007$$	LOBSEGMENT
141557760	SYS_LOB0000109608C00007$$	LOBSEGMENT
143654912	SYS_LOB0000132039C00007$$	LOBSEGMENT
16777216	SYS_LOB0000086960C00007$$	LOBSEGMENT
Here my doubt is my my blob table contains different segment names.

Regards,
Poorna Prasad.S

Edited by: SIDDABATHUNI on Jan 17, 2012 12:29 PM

Edited by: SIDDABATHUNI on Jan 17, 2012 12:31 PM
1 - 5

Post Details

Added on May 23 2016
6 comments
1,737 views