SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[11.1.125 Pro] - Generated code issues

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[11.1.125 Pro] - Generated code issues
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 1721

Post [11.1.125 Pro] - Generated code issues Reply with quote
Having Always Add Delimiters set to Always add apostrophes `` is definitely not without side-effects. I have a stored procedure that looks like this:


code completion (upon selecting the stored procedure from the list after CALL) will insert the following code into the editor:
Code:

CALL `usp_add_table_to_clear`(v_`a_test_case_set_name`, v_`a_schema_name`,
                              v_`a_table_name`)


SA appends the prefix v_ in front of the arguments but only after surrounding it with the delimiters and that results in a syntax error.

I have a few questions:
#1 is that prefix (v_) necessary? Is that hardwired? Can it be disabled or even better, customized?
#2 the formatting of the inserted code is odd. Why is it broken into two lines after the second argument? Checking the code it generates for other procedures (having fewer or more arguments) I guess it tries to keep the code width at 80 characters. Is that also hardwired? None of my formatting styles use that value, they are set to use much longer lines (the shortest is set to 160 characters).

Also, the statement delimiter is not added to the code though there isn't anything that could be added to it so it could be closed with a ; without any problems.
Thu May 21, 2020 12:19 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1721

Post Reply with quote
Additional side-effects can be observed in this short video here:

When selecting arguments of a stored procedure to pass to another stored procedure called in the current one, SA adds another two sets of delimiters to the arguments, creating a syntax error. This only happens if they are selected from the popup for the stored procedure and they can be selected from the argument list because they have the same name. When selecting the arguments from the popup for the local variables, they are inserted properly.
Mon May 25, 2020 5:11 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7125

Post Reply with quote
For #1 unfortunately I don't know where v_ comes from. I will need to ask for help and get back to you.

I thought I knew the answer to #2, it suppose to wrap text lines after reaching "Line Length for Code Wrapping" parameter value, which is 120 characters by default. However I tried that and it doesn't work as I expected. I suspect it's a defect and the value is hard-coded somewhere in the legacy part of the code, it should be using the configured value.
Sat Jun 13, 2020 3:06 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
Page 1 of 1

 
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.