Toad World® Forums

More formatting fun


#1

This doesn’t change at all when you format. If, however, you change the /* */ to – then see below:

CREATE OR REPLACE PROCEDURE trex_get_acct_signr_pr2
(var_exp_cat_in in varchar2,
var_exp_amt in number,
var_signr_list_out out varchar2) is
/* a comment here*/
cursor v_cur is select * from all_objects where object_name = var_exp_cat_in ;
v_signr_list varchar2(4000) := null;
begin
for signr_v2_rec in v_cur
loop
v_signr_list := v_signr_list || signr_v2_rec.object_name || ‘,’;
end loop;
/* remove trailing comma /
v_signr_list := rtrim(v_signr_list,’,’);
/
if v_signr_list is null then testing
var_signr_list_out := ‘sdf’;
else
var_signr_list_out := v_signr_list;
end if; */
var_signr_list_out := v_signr_list;
exception
when others then
var_signr_list_out := SQLERRM;
end;

Better:

CREATE OR REPLACE PROCEDURE trex_get_acct_signr_pr2(var_exp_cat_in IN VARCHAR2,
var_exp_amt IN NUMBER,
var_signr_list_out OUT VARCHAR2) IS
– a comment here*/
CURSOR v_cur IS
SELECT *
FROM all_objects
WHERE object_name = var_exp_cat_in;

v_signr_list   VARCHAR2(4000) := NULL;

BEGIN
FOR signr_v2_rec IN v_cur
LOOP
v_signr_list := v_signr_list || signr_v2_rec.object_name || ‘,’;
END LOOP;

--/* remove trailing comma */
v_signr_list := RTRIM(v_signr_list, ',');
--/* if v_signr_list is null then  testing
--   var_signr_list_out := 'sdf';
-- else
--   var_signr_list_out := v_signr_list;
-- end if; */
var_signr_list_out := v_signr_list;

EXCEPTION
WHEN OTHERS THEN
var_signr_list_out := SQLERRM;
END;


#2

Hi Jet,

Thanks for reporting this. The formatter v5.141 was broken. Fortunately it has been fixed in our internal build.

Thanks,
Vincent


#3

Will a new beta be release that at least has the formatter problems (that were not in 6.2) fixed soon?

thanks


#4

Hi Filipe,

If everything goes well, we will release a new beta early next week. It will fix the recent formatter issues.

Thanks,
Vincent


#5

more “interesting” features:

This formats as follows. Why?

DECLARE
vrpt_intr bsd_rpt.bsd_rpt_intr_no%TYPE;
vgrp_intr bsd_rpt_grp.bsd_rpt_grp_intr_no%TYPE;
v_new_grp_intr bsd_rpt_grp.bsd_rpt_grp_intr_no%TYPE;
vgrp_nam bsd_rpt_grp.bsd_rpt_grp_nam%TYPE;
vdest VARCHAR2(3) := ‘PRD’;
vmerge BOOLEAN := TRUE;
vrpt_cd VARCHAR2(100) := ‘fmq100ar’;
BEGIN
NULL;
END;