Beautifier and cursors

mbo

Member²
Hi,

Beautifier doesn't format cursors correctly.
You can have 500 characters (or more) on the line.

Is this a mistake on my config or a bug to be corrected ?

Declare
Cursor c_lgu(param1 In Number, param2 In Number, param3 In Number, param4 In Number, param5 In Number) Is
Select Null
From dual;
Begin
Null;
End;

I wish to obtain something like
Declare
Cursor c_lgu(
param1 In Number,
param2 In Number,
param3 In Number,
param4 In Number,
param5 In Number) Is
Select Null
From dual;
Begin
Null;
End;

regards
Mbo
 
In addition to that, would it be possible to have an allignment option for column aliases?

e.g.

instead of

Code:
select column1 column1_alias
      ,other_column column2_alias
....
have it look like

Code:
select column1      column1_alias
      ,other_column column2_alias
....
 
Marco, you are right, and not. The alignment of column aliases only works on 'singular' columns.

Code:
select invoice_num   invoice_num
,      invoice_currency_code    invoice_currency_code
becomes

Code:
select invoice_num           invoice_num
      ,invoice_currency_code invoice_currency_code
BUT

Code:
select invoice_num   invoice_num
,      upper(invoice_currency_code)  invoice_currency_code
becomes

Code:
select invoice_num invoice_num
      ,upper(invoice_currency_code) invoice_currency_code
As I frequently use more 'complex' expressions like decode and case in the select statements I never get the column aliases aligned
 
In addition: the following construct does not beautify well:

Code:
cursor c_avy(b_id in number
                ,b_startdate in date
                ,b_enddate in date)
    is
      select end_date
      from   availability
      where  id = b_id
      and    (b_startdate between start_date and end_date or
              b_enddate between start_date and end_date)
    ;
results in:

Code:
cursor c_avy(b_id in number, b_startdate in date, b_enddate in date) is
      select end_date
      from   availability
      where  id = b_id
      and    (b_startdate between start_date and end_date or
            b_enddate between start_date and end_date);
As you can see the where clause is not done correctly.

And I would like to see some more control over de cursor statement. For instance I like to have the IS keyword be placed on a new line (by the way also for all other use of this keyword). An also use the settings for parameter lists for cursor statements. And the placement of the closing semi-column on a new line (only for cursor statements) would be a nice addition. This way the need for empty (comment) lines disappears.
 
Back
Top