Alias Bug

waco_huberwaco_huber Posts: 2
edited September 12, 2007 6:55AM in SQL Prompt Previous Versions
If I start writing a query at the FROM clause, and enter a base table, then add a join clause (to a local table) and alias that table using the keyword AS, the alias is not available in the list of candidates until it is dereferenced in the SELECT clause. This is highly annoying behavior.

Ex.:
1.

SELECT

FROM
[Company] AS c
INNER JOIN [Company] AS p ON

2.
Whilst cursor is one space to the right of ON on INNER JOIN line type p. p will not be listed as a candidate.

3.
On blank line between SELECT and FROM type p. and select a candidate from the list.

4.
After ON on INNER JOIN line type p. You now have correct candidate list.

5.
Undo steps 4 and 3.

6.
Whilst cursor is one space to the right of ON on INNER JOIN line type p. p will not be listed as a candidate- AGAIN!

Comments

  • Bart ReadBart Read Posts: 997 Silver 1
    Hi there,


    As documented in the online help SQL Prompt may not provide correct auto-complete suggestions where syntax errors exist in your SQL. "SELECT FROM" is one such error. The best thing to do is make sure you always start your queries with "SELECT * FROM" and specify the column list, either manually or using the column picker, once you've completed the FROM clause.

    There is an ssf snippet that will insert "SELECT * FROM" quickly, and you can obviously edit this if you want to break it onto more than one line. You'll find the snippet editor in the Options dialog under SQL Prompt > Options from your editor's main menu bar.

    Hope that helps.


    Thanks,
    Bart
    Bart Read
    Principal Consultant
    bartread.com Ltd
Sign In or Register to comment.