SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Disable auto-popup
Goto page Previous  1, 2
 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Disable auto-popup
Author Message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
Quote:
1. Copied:
select *
from database.schema.tablename
where column in (1,2)
2. Used arrow keys to highlight schema.tablename
3. Typed:
diff.viewname
4. Tried to arrow down, then shift-arrow up to highlight entire statement, but pop-up was in the way suggesting table names that also started with "viewname" , so I didn't need it and it grabbed all my arrows. Since the actual object names were short, and I've typed them a lot, it was easier to not use SQL Assistant, so I would rather tell it to wait until I want its help spelling a long name, then to have it jump up and intercept the arrows until I look up from the keys and discover I'm arrowing in the pop-up instead and need to hit ESC and start over.


Based on your sample, I see it may take you a little while to adjust to somewhat different ways to enter SQL code. I believe SQL Assistant is designed for maximum efficiency. Copy/pasting and retyping isn't very efficient in that sense as it requires significantly more keystrokes and switches between different editors. While I don't really have one size fit all solution, I'd like to suggest several examples that may help you to adjust to different code entry methods, which are faster and yet quite simple. So here are some ideas.

Please try the following.
1. Reset SQL Assistant settings to factory defaults, and restart your SQL editor. (NOTE: to reload default settings, in the Options click Import/Export button, then check Load Default Options and OK it twice)
2. For warming up, type cfetch then <Ctrl>, type beginning of some database, schema, or table to quickly jump to it. Select it and press <Enter>. Please review the results. You've got a page of specific code with a few chars entered, right?. Let's erase the resulting code and start fresh.
3. Now, a bit different demonstration, type sg then <Ctrl>, start typing db name, in most cases the popup should locate it after only 1 or 2 typed chars. Once located, press <Arrow>, start typing schema name. Again in most cases the popup should locate it after only 1 or 2 typed chars. Found? press Arrow Right again, start typing table name. This usually takes few chars. Press Enter. Done. Let's erase.
3. In the editor, type your original query without using popups.
select *
from database.schema.tablename
where column in (1,2)
Great, not erase the text in the editor again and type sel, note the the previous query is already being suggested as a candidate. You can pick it without much typing. Isn't that fast?
4. Yet, if demonstration #4 was fast, it wasn't fast enough. If you are going to edit the query and retype the entire "database.schema.tablename" in the text, that is awfully inefficient, too many arrow keys, and cursor movements, typing, etc... If "SELECT * FROM" is the most common operation, try the following
Open SQL Assistant options, go to Code Formatting tab, select your database SQL dialect on the left, perhaps you select T-SQL, expand Keywords section on the right and scroll it almost all the way down, find [Preferred keywords] section. After "select" keyword add "select * from" without quotes and close options using OK button.

Now, perhaps we want to enter "SELECT * FROM AdventureWorks.dbo.BusinessCategories WHERE [Type]='a'" query. We can get it done with
se<Arrow><Enter><Space>
start typing db name (NOTE: in my test db, typing ad is sufficient to locate AdventureWorks)
<Arrow> (NOTE: in my test db, "dbo' is the top most schema name in the database)
<Arrow>
start typing table name, in my case typing "b" leaves just that table
<Enter><Space>wh<Enter>t<Enter>='a'

Done. Well the above required 20 key presses, most arrows, Enter and Space keys that could be pressed without looking at the keyboard, took me about 3 to 4 seconds.

The problem with efficiency would start if my database names and table names begin with the same letters and there are lots of tables, perhaps all my table names begin with "Adventure" prefix. However, I only code for 1, 2 or 3 databases. So to improve my coding efficiency, I could use the same method as described above use the method as above, in [Preferred keywords] section I can add " SELECT * FROM AdventureWorksAdve" and "SELECT * FROM SomeOtherDatabase" and this way after typing just 2 letters se I can get a prompt with 2 ready to use suggestions for 2 most common databases. And I never need to type them. Moreover, as soon as I pick one of the suggested SELECT * FROM database" choices, I can type dot symbol and immediately get a prompt for schema name. Isn't that cool?

Hope the above hints are helpful. If they are not, let's see what else we can customize/tune in SQL Assistant options to help you with codeing.
Tue Feb 07, 2012 1:15 am View user's profile Send private message
tkdennis



Joined: 03 Feb 2012
Posts: 6
Country: United States

Post Reply with quote
Thanks a lot for the tutorial. That would take a lot of getting used to, and we have a lot of objects with similar names so it takes a while to get distinctive enough for the right object to float high enough to pick. I uninstalled the program for now, and maybe another time I'll try it again.

Thanks for your help,
Traci
Mon Feb 13, 2012 5:26 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
Well, I can't imagine how typing the full name of the object without the aid of SA could be faster than either fully typing it with SA (in which case it is just as fast/slow) or typing it until it can be picked by a simple enter/space/tab/whichever (in which case it might require fewer keys). The popup vanishes as soon as you press enter/space/tab at the end of the object name but since you probably press one of those anyway it does not really count. Other cases involving joins are many times entered with a simple enter, incomparably faster than typing anything.

Regarding the objects with similar names, few of our developers had the habit of always prefixing their tables/views/functions/columns/whatever with different things like schema, table or even developer names, resulting in lots of similar names. While this did not entirely cover the "similar names" topic, it created a great deal of annoyance in other developers (both SQL and other). It also made the code and docs difficult to read. Though some disagree and sometimes it is inevitable, I consider that (and similar naming as well) a bad design/programming practice and avoid it like the plague. Still, there's no accounting for taste so I guess it's your call. Luckily, the habit was weeded out way before I started using SA but some parts of legacy code are still haunting us. I use the copy-paste method there (with the popup vanishing on CTRL + v) to insert the common part of the name and press CTRL + Space immediately to be able to continue with popup. It is a pain in the ... now but it was a nightmare before SA.

By the way, do not fall for "SQL Assistant can boost your SQL coding productivity by 300%". That's "marketing gibberish" :) The actual gain can be much higher with extensive use of snippets and customized preferred keywords. I had it somewhere around 2300% before switching from 6.0 to 6.1.

It's very inconvenient to go without SA once you get used to it.
Mon Feb 13, 2012 7:40 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.