Toad World® Forums

Formatting Tool


#1

I’m not sure if this forum is the right place gfor the Formatting tool, but I have a couple questions:

  1. Why can’t we keep the Formatting Options window open and get back to SQL Nav? When you are playing with the settings, you have to close the Options, try them, and then open the Options again. Even if you Save, you still have to close the window.

  2. Is there a way to differenciate between an OR in a WHERE clause and an OR in an IF statement? I want the OR to be on a new line in the WHERE clause, but in the if statement, I want it to stay on the same line.

I guess while I’m talking about it, I have a couple things I can’t figure out how to do:
3) Is there any way to get a procedure call to look like this?
PROCEDURE print_error (
p_parameter1 IN VARCHAR2,
p_parameter_number IN NUMBER
)
IS

The closest thing I can make it do is this:
PROCEDURE print_error(
p_parameter1 IN VARCHAR2,
p_parameter_number IN NUMBER
) IS

And make a call to a procedure look like this:
print_error (
p_parameter1 => ‘x’,
p_parameter_number => 0
);

Instead of this:
print_error(
p_parameter1 => ‘x’,
p_parameter_number => 0
);

  1. Open/Fetch
    Is there any way to make it not insert a line after the Open and after the Fetch:
    Look like this:
    OPEN cur_org(p_org_code);
    FETCH cur_org
    INTO l_organization_id;
    CLOSE cur_org;

Instead of:
OPEN cur_org(p_org_code);

FETCH cur_org
INTO l_organization_id;

CLOSE cur_org;

Thanks.
-Charlie


#2

Hi Charlie,
I’ll quickly answer Question 1
There is a CR (raised by me) to have this looked at. You cannot use nav when the Formatter options are open. This is not a good thing (as you’ve noticed).

We’ll get back to you on the other questions momentarily…
Jaime


#3

Hi Charlie,

Following Jaime’s answer, we will raise enhnacement request on your behalf to differentiate formatting OR between SQL statements and IF…THEN iterations.
Point (3) formatting can be achieve with current build (see attachment) and for point (4) issue we have had already enhancement request, on which implementation we depend on third party development cycle.

Rgds,
Andrew
formatting_proc.zip (687 KB)


#4

Thanks.

That solution for the procedure call does not really work. You are esentially making the indent size large enough to put the parameters past the procedure name. The normal indent size would typically be 2 - 5. Setting it to 12 would spread the rest of your code all the way across the screen (inside several IF stmts, etc.). Plus, 12 would not work if your procedure name is long, like get_the_next_number_sequence. Then you would have to set up the indent size to be 30.

Thanks.
-Charlie


#5

You’re right Charlie! I will raise ER for this issue as well.