What are the challenges you face when working across database platforms? Take the survey
Options

Auto complete in field list portion of SELECT

MikeyCMikeyC Posts: 249 Bronze 3
edited September 12, 2007 1:50PM in SQL Prompt Previous Versions
I just wanted to check and see how the auto complete is intended to work in the field list portion of a SELECT statement.

Given this query:

SELECT DISTINCT
tdl_id<cursor1>
INTO #test
FROM edic_cga_details<cursor2>;

If at <cursor1> location I type ", " nothing happens, until I start to type a field name. On the other hand if at <cursor2> location I type "WHERE " a suggestion pop-up immediately comes up. Same happens when adding and AND to the where.

Should the suggestion pop up come up as soon as I start to add a field in the field list section of a SELECT statement?

Comments

  • Options
    Please see my other post.
    Thanks,
    Bart
    Bart Read
    Principal Consultant
    bartread.com Ltd
  • Options
    MikeyCMikeyC Posts: 249 Bronze 3
    I was being lazy and re-used the same example as last time, so try this one: (the INTO part has nothing to do with the behavior.)

    Given this query:

    SELECT DISTINCT
    tdl_id<cursor1>
    FROM edic_cga_details<cursor2>;

    If at <cursor1> location I type ", " nothing happens, until I start to type a field name. On the other hand if at <cursor2> location I type "WHERE " a suggestion pop-up immediately comes up. Same happens when adding and AND to the where.
  • Options
    Bart ReadBart Read Posts: 997 Silver 1
    Sorry, no I was being lazy and didn't read your post properly. The popup behaviour can be configured on the "Pop-up Behaviour" tab in the options dialog. Click SQL Prompt > Options on the main menu of your editor.

    Generally SQL Prompt only pops up the list once you've started typing a word, so you need to enter at least one character, however if you go to the "Triggering" screen you'll see a list of words after which the popup is automatically triggered. This explains the difference in behaviour you're seeing since by default Prompt is configured to pop up after WHERE.

    Hope that helps.


    Thanks,
    Bart
    Bart Read
    Principal Consultant
    bartread.com Ltd
  • Options
    MikeyCMikeyC Posts: 249 Bronze 3
    OK, that makes sense. (Maybe I should RTFM, or explore the options a little more.)

    I tried adding "," or ", " as a trigger word, but it doesn't appear to work. I'm not sure I would always want it to be a trigger anyhow, I would only want it to trigger when adding a field to a select statement probably. Probably not in a function or IN() clause, etc.

    It isn't that big of a deal, I can start typing or hit ctrl-space, but it would be nice.
  • Options
    Bart ReadBart Read Posts: 997 Silver 1
    I tried that too just to be sure what would happen (it's so long since I wrote the popup trigger code) but as you say, it didn't do anything. It's something we might consider for the future. I can certainly see that in the SELECT column list, or in the GRANT/REVOKE/DENY column lists, as well as a few other places that behaviour would definitely make sense.
    Thanks,
    Bart
    Bart Read
    Principal Consultant
    bartread.com Ltd
  • Options
    MikeyCMikeyC Posts: 249 Bronze 3
    I agree. It's not anything critical, and I certainly wouldn't want to hold up the 3.6 release for it, so just stick it somewhere on the "possibly in the future" list.

    Thanks for all the quick help!
Sign In or Register to comment.