Toad World® Forums

Formatter 123 error


#1

Hi

here is the code …

BEGIN
FOR f_count IN 1 … 10
LOOP
CASE (f_count MOD 7)
WHEN 1
THEN
DBMS_OUTPUT.put_line (‘1’);
/*ADVICE(7): This point cannot be reached (dead code) [123] */
/*ADVICE(7): This point cannot be reached (dead code) [123] */
WHEN 2
THEN
DBMS_OUTPUT.put_line (‘2’);
/*ADVICE(12): This point cannot be reached (dead code) [123] */
/*ADVICE(12): This point cannot be reached (dead code) [123] */
ELSE
DBMS_OUTPUT.put_line (‘no’);
END CASE;
END LOOP;
END;

why the advice 123?

as you can see by inspection or by the output

1
2
no
no
no
no
no
1
2
no

it’s wrong advice :frowning:

Regards
Filipe


#2

Hi Filipe,

Thanks for pointing this out. Currently we still use an old advisor to generate the advices. There’re some known bugs on it but we still have to wait for the new advisor to be complete. As per your earlier discovery(http://sqlnavigator.inside.quest.com/thread.jspa?threadID=8483&tstart=0), I have already created a CR for advice rule 123. Now I will add this case to this CR for them to refer to.

Thanks,
Vincent


#3

Just to report that this problem it’s still there (build 1749)


#4

Hi Filipe,

We’re sorry to let you know that all the issues/enhancements regarding advices and rules are not implemented yet. The formatter team has been working on creating a new advisor engine but it hasn’t been done and SQL Nav could not pick it up at the moment. I will keep you posted once we get any progress.

Thanks,
Vincent


#5

Hi from what I now the formatter team is another one and does that formatter that is used by toad and sql nav.May I suggest a creation of a forum shared by both kind of users and focus on formatter to interact with that team?


#6

Hi Filipe,

There’s no separate forum for the formatter because it’s a component rather than a complete product of Quest. Your idea is good but I’m not sure whether it’s applicable from the company perspective. I have forwarded your idea to the formatter team.

Before anything changes, please raise every issue or idea regarding formatter in our forum. We will try our best to work with the formatter team and get back to users as quick as we can.

Thanks,
Vincent


#7

Suggestion!

Would be nice if the formating option would work on a thread. I have a statement of over 1.2 million characters. The formating went well but it tooked a lot of time resulting in blocking the sqlnav. The same problem for explain plan tool. this should also be started on a thread.


#8

Hi Catalin,

Thank you for your suggestion and request.

We have already put it on the list to do in those areas for you post v6.3.

Thanks and regards,
Bruce


#9

Hi

Just to report another test case (QP5 v5.158)

DECLARE
a PLS_INTEGER := 1;
b PLS_INTEGER := 1;
c PLS_INTEGER := 90;
BEGIN
IF a + b + c != 100
/*ADVICE(6): Complex expression not fully parenthesized [404] */
/*ADVICE(6): Complex expression not fully parenthesized [404] */
THEN
RAISE NO_DATA_FOUND;
/*ADVICE(10): Raise of a predefined exception [551] */
/*ADVICE(10): Exception not handled inside unit [550] */
END IF;

DBMS_OUTPUT.put_line ('Here');
DBMS_OUTPUT.put_line ('Here 2');

END;

To avoid the 404 advice (double…i think it should be cleaned to only one…or even cleaned due to operators order ) I change the code to

DECLARE
a PLS_INTEGER := 1;
b PLS_INTEGER := 1;
c PLS_INTEGER := 90;
BEGIN
IF (a + b + c) != 100
THEN
RAISE NO_DATA_FOUND;
/*ADVICE(8): Raise of a predefined exception [551] */
/*ADVICE(8): Exception not handled inside unit [550] */
END IF;

DBMS_OUTPUT.put_line ('Here');

/*ADVICE(13): This point cannot be reached (dead code) [123] */
/*ADVICE(13): This point cannot be reached (dead code) [123] */
DBMS_OUTPUT.put_line (‘Here 2’);
/*ADVICE(16): This point cannot be reached (dead code) [123] */
/*ADVICE(16): This point cannot be reached (dead code) [123] */
END;

and we get the 123 (also doubled in each code line and I cannot figure out why it’s duplicated)