Forums » Toad for SQL Server General

Thread: Issues with Code Snippets


Permlink Replies: 1 - Pages: 1 - Last Post: Mar 20, 2012 6:36 AM by: Julia Ponomareva Threads: [ Previous | Next ]
DarrenM


Posts: 167
Registered: 2/17/10
Issues with Code Snippets
Posted: Mar 16, 2012 3:36 PM
  Click to reply to this thread Reply
Attachment image001.png (18.1 K)
Attachment image002.png (18.2 K)
Attachment image003.png (17.7 K)
Attachment image004.png (17.9 K)
Attachment image005.png (8.1 K)
Attachment image006.png (8.3 K)
Attachment image008.png (48.7 K)
Attachment image007.png (2.6 K)
Attachment image009.png (2.3 K)
Attachment image010.png (984 bytes)
Attachment image011.png (747 bytes)
Attachment image013.png (15.5 K)
Attachment image014.png (7.4 K)







I’m finding the snippet creation behavior strange/inconsistent in the
current release.

Here’s an example. I wanted to create a new snippet called
“con” for “Constraint” containing this structure:

CONSTRAINT DF_$TableName$_$FieldName$ DEFAULT ($EnterDefaultHere$)

If you type the statement in the snippet window like this:

CONSTRAINT DF_TableName_FieldName DEFAULT (EnterDefaultHere)

Highlight the “EnterDefaultHere” text that you want to make into a
parameter, and then click the “+” button on the Parameters tab to
add a new parameter, you get this:

CONSTRAINT DF_TableName_FieldName DEFAULT ($EnterDefaultHere$)

automatically. (i.e. it creates the parameter, and adds the $ prefix and suffix
to what you had highlighted)

ISSUE #1 – Parameter not automatically prefixed/suffixed (apparently when
text selected is touching another character that isn’t a bracket).

Now, highlight the “TableName” text, and click the Add button:
“+”

CONSTRAINT DF_TableName_FieldName DEFAULT ($EnterDefaultHere$)

This time you get this result:

CONSTRAINT DF_TableName_FieldName DEFAULT ($EnterDefaultHere$)

Expected Result:






Attachment not added (too many attachments): "image015.png"
Attachment not added (too many attachments): "image016.png"
Attachment not added (too many attachments): "image017.png"
Attachment not added (too many attachments): "image018.png"
Attachment not added (too many attachments): "image012.png"
Attachment not added (too many attachments): "image019.png"
Attachment not added (too many attachments): "image020.png"

Darren
Julia Ponomareva


Posts: 78
Registered: 11/15/11
Re: Issues with Code Snippets
Posted: Mar 20, 2012 6:36 AM   in response to: DarrenM
  Click to reply to this thread Reply

Hello, Darren!

Thanks for your so detailed report.
We will definitely create CRs to improve it.

Issue #1. The issue is related with the "_" character, because it works normally if define the parameter for the text from "DF.TableName.FieldName" structure.

Best wishes, Julia.


QC Analyst | R&D | Quest Software is now part of Dell
Legend
Guru: 2001 + pts
Expert: 751 - 2000 pts
Enthusiast: 31 - 750 pts
Novice: 0 - 30 pts
Moderators
Helpful answer (5 pts)
Answered (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums