Beautifier with "using" clause

edmsos

Member
Hello,

We are facing issue that beautifier struggling with "using" clause, all columns is in one line, and it can be hundreds of symbols.
In our case it should be one item per line.
Do you have some advices?

Code example and beautifier config attached.

Code:
function get_smth return sys_refcursor is
  ref_return sys_refcursor;
  l_sql      clob;
begin
  l_sql := 'select.....';
  open ref_return for l_sql
    using to_number(l_cols(1).col_value), l_cols(2).col_value, l_cols(3).col_value, to_number(l_cols(4).col_value), to_number(l_cols(5).col_value), l_cols(6).col_value, l_cols(7).col_value, l_cols(8).col_value, l_cols(9).col_value, l_cols(10).col_value, to_number(l_cols(11).col_value), to_number(l_cols(12).col_value), to_number(l_cols(13).col_value), to_number(l_cols(14).col_value), to_number(l_cols(15).col_value), to_date(l_cols(16).col_value), to_date(l_cols(17).col_value), to_date(l_cols(18).col_value), to_date(l_cols(19).col_value), to_date(l_cols(20).col_value), l_cols(21).col_value;
  return ref_return;
end get_smth;

View attachment beautifier.txt
 
This does indeed not format properly. We'll fix it.

At the moment I can only suggest that you format this by hand, and use the NoFormat directive:

Code:
function get_smth return sys_refcursor is
  ref_return sys_refcursor;
  l_sql      clob;
begin
  l_sql := 'select.....';
  -- NoFormat Start
  open ref_return for l_sql
    using to_number(l_cols(1).col_value),
          l_cols(2).col_value,
          l_cols(3).col_value,
          to_number(l_cols(4).col_value)
          ...
          ;
  -- NoFormat End
  return ref_return;
end get_smth;
 
Last edited:
Thank you for your reply Marco.
We will use this workaround (didn't knew such functionality to avoid formatting) and will look forward to get update with permanent fix :)
 
Back
Top