This discussion is archived
5 Replies Latest reply: Mar 5, 2006 5:23 PM by 306078 RSS

PL/SQL code "collapse" functionality

306078 Newbie
Currently Being Moderated
A couple of questions relating to the code "collapse" functionality in PL/SQL (the +/- in the gutter that allows you to hide or show blocks of code).

1) Is there somewhere that we can post/send examples where this is not working properly (without having to dump a 45K file on the forum)?

2) Is it possible to get this functionality to work on the view versions of the PL/SQL tabs rather than just the edit versions?

3) Is it possible to get this functionality to only collapse the individual components of an IF THEN ELSIF ELSE END IF structure? For example, if I want to hide the code executed if the condition is true but display the code executed if it is false.
  • 1. Re: PL/SQL code "collapse" functionality
    306078 Newbie
    Currently Being Moderated
    This functionality (which is presumably dependent on the PL/SQL formatter) is still not working properly with my example with v1343 (full install - no updates as v1343 appears to have broken updates for me).

    Also, no responses on my request for this available in view and changing the level at which we can "collapse" IF structures.
  • 2. Re: PL/SQL code "collapse" functionality
    306078 Newbie
    Currently Being Moderated
    Still no response ...

    Can someone in development please comment on:
    1) Can we get the expand/collapse functionality available in view-only PL/SQL tabs?
    2) Can we change the expand/collapse functionality so that we can collapse each individual code block within an IF THEN ELSIF THEN ELSE END IF structure?

    Example of this expand/collapse functionality not working properly (a much simplified version of the real package I have and with hard-coded values so it compiles):

    CREATE OR REPLACE
    procedure test_plsql_formatter is
    begin
    if upper('ANZ_EFT') = 'BNZ_EFT' then
    IF true THEN
    dbms_output.put_line('Before BNZ_EFT');
    END IF;
    dbms_output.put_line('Running BNZ_EFT script');
    elsif upper('ANZ_EFT') = 'SWT_EFT' then
    dbms_output.put_line('Running SWT_EFT script');
    elsif upper('ANZ_EFT') = 'X12_EFT' then
    dbms_output.put_line('Running X12_EFT script');
    else
    IF true THEN
    dbms_output.put_line('Before execute immediate');
    end if;
    EXECUTE IMMEDIATE 'begin null; end;';
    IF true THEN
    dbms_output.put_line('After execute immediate');
    end if;
    end if;
    end;

    The expand/collapse nodes for this procedure allow me to:
    . collapse the whole procedure
    . collapse each of the "if true then ... end if;" blocks of code
    . collapse from the "elsif upper('ANZ_EFT') = 'X12_EFT' then .. end if;" block of code

    It does not allow me to collapse the initial if.

    What I would like to be able to do is collapse this procedure as follows:

    CREATE OR REPLACE
    procedure test_plsql_formatter is
    begin
    if upper('ANZ_EFT') = 'BNZ_EFT' then [...]
    elsif upper('ANZ_EFT') = 'SWT_EFT' then [...]
    elsif upper('ANZ_EFT') = 'X12_EFT' then [...]
    else [...]
    end if;
    end;
  • 3. Re: PL/SQL code "collapse" functionality
    369690 Newbie
    Currently Being Moderated
    It will be better if
    1. Big select / Insert statements could be collapsed just to make scrolling through codes easy.
    2. Any arbitary number of lines selected and collapsed.. may be a big comment block..as one can do in GVIM..

    --Sanjeev                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
  • 4. Re: PL/SQL code "collapse" functionality
    Kris Rice Employee ACE
    Currently Being Moderated
    We will improve folding in a future version. Hoepfully it will encompass most of these requests.

    Although I use folding in vim as well, I don't think we'll get all the functionality in there :)


    -kris
  • 5. Re: PL/SQL code "collapse" functionality
    306078 Newbie
    Currently Being Moderated
    Kris,
    I was wondering what the official term was - I tried finding the name before posting, but didn't have any luck.

    I can understand that enhancements to the folding functionality will not come until future versions (ie post production). Are you saying that fixing the incorrect folding (as per the example above where it does not select the initial if statement for folding) is also not going come until post production?