SQL Assistant marks lines where the database server reports syntax errors. SQL Assistant sends your code from the editor to the database server and asks it to syntax check it, it then searches text in the editor for reported lines and columns and highlights them with a red wavy underline

Regards

Thu Jun 18, 2009 6:24 pm

Olegon

Joined: 07 Sep 2009Posts: 39Country: Kazakhstan

Re: prompt for variable names

gmcintosh wrote:

Is there a way that SQL Assistant will let you highlight a block of code and when you execute it, automatically check for declarations for any variables earlier in the proc (before the highlighted code) and then display a dialog box listing all the variables in the highlighted code, the expected data types based on the earlier declarations, and a textbox next to each to allow a value ot be enterred. I know Oracle tools such as TOAD do this. It would save a lot of time when debugging, as you can execute code insitu regardless of whether it contains variables or not.

This is a good idea. Very often encountered such a problem. I support this idea.

Alias "a" for table Accounts added automatically.
Wanted to be able to specify in options default table hint (e.g "nolock") that will be added automatically for each table in query.

Code:

select * from dbo.Accounts a (nolock)

Tue Sep 08, 2009 4:22 am

SysOpSite Admin

Joined: 26 Nov 2006Posts: 6739

Quote:

Re: prompt for variable names

Guys,

SQL Assistant implements semantical code parsing. It doesn't parse the procedural logic. This is done by your database server. Therefore prompting to variable values is not an option. Besides variables are no like substitution variables or macros. Their values must be fed to the database, not to SQL Assistant

Yet, there is an enhancement in in the new features queue for adding $PROMPT$ macro which you would be able to use to inject your own prompts into the code. This way you can make SQL Assistant to prompt you for values and replace them (the text) in the SQL code before sending the code to the database server. I hope this will satisfy your need. Of course such macros can be entered inside comments so that they don't affect normal code compilation or execution.

Tue Sep 08, 2009 1:07 pm

SysOpSite Admin

Joined: 26 Nov 2006Posts: 6739

Thanks for your suggestion for automatic hint generation. I mean "(nolock)" and similar hints. I'm going to submit that as an enhancement request for further implementation review.

Tue Sep 08, 2009 1:12 pm

pvdm

Joined: 11 Mar 2008Posts: 22Country: New Zealand

Would it be possible to have SQL Assist highlight warnings of unused (but declared) variables, temp tables and table variables? Similar to what you would find in visual studio, but maybe a green squiggly underline instead of a red one. I know it does show undeclared variables but it would be nice to have it the other way around as well.

Wed Dec 23, 2009 5:38 pm

SysOpSite Admin

Joined: 26 Nov 2006Posts: 6739

Thank you very much for you suggestion. I've added it as an enhancement request to the issue tracking system

Wed Dec 23, 2009 7:59 pm

gemisigo

Joined: 11 Mar 2010Posts: 1477

Supporting unsupported window classes (or a workaround)

SQL Assistant reports "Unsupported window class (SEditor)" when I try to add the editor of procedure definition tab in PowerDesigner to the target list. Which property/properties of a class makes it unsupported? Are you planning to support this one or is it too difficult? If it is, is there a workaround?

Fri Mar 12, 2010 7:08 am

SysOpSite Admin

Joined: 26 Nov 2006Posts: 6739

When you add a new target, SQL Assistant tests it for compatibility by sending several standard Windows edit control messages (like select text, return current position, etc...). If it does not get the required response from the editor, it usually says "Unsupported window class." Basically, SQL Assistant working depends on the editor implementation. In case the editor doesn't implement standard edit interface, SQL Assistant is unable to hook into it.

However, sometime you may get this error for a different reason. The editor could be inside a frame, in a child window, etc…, When you start the target application, the edit box doesn't have a focus by default and when you press Ctrl+Shift+F5 to add a target, SQL Assistant grabs the current window with focus (whatever it is, a frame, toolbar with a menu, etc…) and complains that the current window is not good. When you press Ctrl+Shift+F5, please make sure the focus is in the edit window and the edit caret is blinking

Fri Mar 12, 2010 9:46 am

gemisigo

Joined: 11 Mar 2010Posts: 1477

I see. It's really an unsupported class then. The editor had the focus and the caret was blinking. It might not implement standard edit interface though. Sometimes it behaves a bit strange.
It could have been a very easy and convenient way to implement stored procedures, but it won't work. Ehh, never mind.

Fri Mar 12, 2010 10:02 am

rick_townsend

Joined: 12 Oct 2009Posts: 14Country: New Zealand

Variables not displayed in list on long scripts

As brought up in another thread, could the look ahead and lookback code parsing limit be added to the configurable settings? The hard-coded limit of 10k lines covers most scripts, but for the occasion when we work on a larger script it would be nice to be able to increase that limit - even at the cost of performance.

With the current limit, the result of passing line 10,001 on a script is that only static objects are displayed in the intellisense list (no variables, table variables, etc.)

Tue Mar 30, 2010 3:59 pm

SysOpSite Admin

Joined: 26 Nov 2006Posts: 6739

Thank you. I already submitted a request to review whether it is possible to allow configurable parameters for internal buffers and code scanning procedures

Tue Mar 30, 2010 8:20 pm

seth.rothman

Joined: 29 Jan 2008Posts: 42Country: United States

Copy & Paste Enhancement (Paste Delimited)

Something I find myself doing all the time is writing a SELECT and then using some part of the results in the WHERE for a second piece of SQL I'll write. For example, I may write something that returns multiple OrderID's only to use those ID's in a SELECT * FROM OrderDetail WHERE OrderID IN (1,2,3,4,5). I end up copying the 5 OrderID's from the results window of the first SQL statement, copying them to the clipboard, pasting them into the SQL editor and then inserting the commas manually. It'd be cool to have a menu option to Paste Delimited that would take the text on the clipboard and paste the values already comma-separated.

Thu Apr 01, 2010 4:33 pm

judahr

Joined: 09 Mar 2007Posts: 314Country: United States

$COLUMN$ macro

Suggest a new macro called $COLUMN$. It would produce a list of columns from the preceding $OBJECT$ selection, but you pick one column rather than listing all of them.

Tue Apr 06, 2010 3:01 pm

SysOpSite Admin

Joined: 26 Nov 2006Posts: 6739

I think that won't work well and cause one popup on top of another, or 2 consecutive popups.

Can you use column list expansion feature already available in the $OBJECT$ popup and pick a specific column from there?