Skip to Main Content

SQL Developer

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!

Script output gutter (4.1EA2)

trentMar 10 2015 — edited Mar 11 2015

I just upgraded to EA2 that was released today, and I notice the script output has a line gutter (or line margin if you prefer) - as well as wrapping to a width of 80.

Before I upgraded (which I didn't migrate any settings), script output would go indefinitely across the page for each row (when querying),  and I dont recall seeing a gutter (in script output). Now there is a visual gutter in script output and it is wrapping text at a set width.

Is the script output wrap width configurable? (I know I can do `set linesize x` to increase it, but I mean a setting that persists. Also doing that then means you still have a vertical line through your query output.)

The visual line gutter seems to be directly linked to the setting in Code Editor => Display => Show Visible Right Margin. Changing that will move both the vertical line in the code editor and the script output. Probably deserves it's own config option?

Comments

EdStevens
948744 wrote:
Hi, 

I have been experimenting on exception handling in oracle plsql. During my experimentation I made the following anonymous plsql block.

<snip>

Did you notice the name of this particular forum?

Please close this thread and ask your question in 3077
BluShadow
Question now moved to Oracle Discussion Forums » Oracle Database » SQL and PL/SQL
BluShadow
Answer
The problem in your block 2 code is that you've not just used the same exception name, but you've assigned them with the same exception code. If the code is different then it will work...
SQL> set serverout on
SQL> ed
Wrote file afiedt.buf

  1  <<outer_block>>
  2  declare
  3      exc exception;
  4      pragma exception_init(exc,-20001);
  5  begin
  6      <<inner_block>>
  7      declare
  8          exc exception;
  9          pragma exception_init(exc,-20002);
 10      begin
 11          raise_application_error(-20002,'Error raised');
 12      exception
 13          when outer_block.exc then
 14              dbms_output.put_line('outer Exception caught ' );
 15          when inner_block.exc then
 16              dbms_output.put_line('Inner Exception caught ' );
 17      end;
 18* end;
SQL> /
Inner Exception caught

PL/SQL procedure successfully completed.

SQL> ed
Wrote file afiedt.buf

  1  <<outer_block>>
  2  declare
  3      exc exception;
  4      pragma exception_init(exc,-20001);
  5  begin
  6      <<inner_block>>
  7      declare
  8          exc exception;
  9          pragma exception_init(exc,-20002);
 10      begin
 11          raise_application_error(-20001,'Error raised');
 12      exception
 13          when outer_block.exc then
 14              dbms_output.put_line('outer Exception caught ' );
 15          when inner_block.exc then
 16              dbms_output.put_line('Inner Exception caught ' );
 17      end;
 18* end;
SQL> /
outer Exception caught

PL/SQL procedure successfully completed.
Marked as Answer by sudher · Sep 27 2020
BluShadow
Oh, and the reason for that is described here...

http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/errors.htm#sthref2000

PRAGMA is a compiler directive, not a run time directive, so you can't re-assign the same code to different exceptions on-the-fly during execution of your code, hence why the code was complaining because it was considering your outer EXC and inner EXC to be the same code and hence you were effectively testing for the same exception value twice, regardless of you prefixing the name with the outer/inner labels.

You can certainly re-use exception names at run time and that follows standard variable scoping rules, but if you assign exception names to actual error code values, those need to be either unique or, if you've assigned multiple exception names to the same code you need to ensure you only test for one of them within your exception handlers.
1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 7 2015
Added on Mar 10 2015
0 comments
539 views