Some things about column selection behavior in sql window

fraenkg

Member³
I wanted to comment out a column in a select union script and use the column mode for this. Picture p10.png shows the initial situation. The desired result is shown in picture p11.png.
1st attempt: The cursor is placed directly in front of 'Info1'. Then the cursor is positioned in front of 'Info5' with the mouse while holding down the ALT key. You can't see that the column mode is activated. If characters are entered via the keyboard, in this case [/] + [*], something unexpected happens (see appendix picture p12.png). The slash is in column c2 and '*' in front of 'Info5'. Use Ctrl + Z to restore the initial state.

2nd attempt: The cursor is placed directly in front of 'Info1' again. Then the cursor is positioned behind the apostrophe of 'Info5' with the ALT key pressed down. You can see the selected characters in the column (picture p13.png). Now the desired character sequence ([/] + [*] + [']) can be entered. The additional apostrophe is necessary because the selected one will be overwritten. The result is shown in picture p14.png.
If the cursor is now placed behind 'Info1' with the keyboard (not with the mouse!), I can insert more characters in column mode. So here the comment closure with ([*] + [/]). The goal has thus been achieved.
However, I cannot see whether I am actually still in column mode. And I obviously do that as long as the cursor is not positioned anywhere with the mouse or the line is left with the cursor keys.
But if, for example, the alias name 'c3' is to be changed to 'c4', the following could happen. Without leaving the line and without using the mouse, I position the cursor between the characters 'c' and '4' of the alias name using the arrow key and type [4] + [Delete] to replace the 3 with a 4. Since the editor is still in column mode, the result is as shown in Figure p15.png. It is notable, that after entering [Delete] the column mode is exited.

My conclusion:
a. at least one character must be selected in order to work meaningfully with 'column selection'.
b. it is not always optically recognizable whether the editor is in column mode or not.

But if you know these quirks, it is an extremely helpful functionality!

(Tested with version 14.06 64Bit on Windows10 pro 20H2)

p10.png p11.png p12.png p13.png p14.png p15.png
 
Last edited:
Back
Top