SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
$OBJECT(...)$ macro anomaly

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
$OBJECT(...)$ macro anomaly
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post $OBJECT(...)$ macro anomaly Reply with quote
$OBJECT(table)$ mistakenly inserts schema name instead of table name. $OBJECT(column)$ does the same, and my first thought for a workaround, $COLUMNS$ does not insert anything in case a single column is selected.

Also, $OBJECT()$ macro no longer inserts declared variable names!!!
Sun Nov 04, 2012 7:37 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7854

Post Reply with quote
Thank you. I have submitted a new high priority ticket #SA0020609
Mon Nov 05, 2012 11:58 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
Thank you very much.
Mon Nov 05, 2012 3:21 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7854

Post Reply with quote
Please see http://www.softtreetech.com/support/phpBB2/viewtopic.php?t=23812
Fri Nov 30, 2012 1:45 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Re: $OBJECT(...)$ macro anomaly Reply with quote
gemisigo wrote:
$OBJECT(table)$ mistakenly inserts schema name instead of table name. $OBJECT(column)$ does the same, and my first thought for a workaround, $COLUMNS$ does not insert anything in case a single column is selected.

Fixed.

gemisigo wrote:

Also, $OBJECT()$ macro no longer inserts declared variable names!!!

Not fixed. Also, while the popup does include item Local Variables, it is not expandable and the variables themselves are not in the list. Typing "@" filters for variables and they can be selected but nothing is inserted into the editor.
Sat Dec 01, 2012 3:24 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7854

Post Reply with quote
In previous releases $OBJECT$ macro was not designed to display any variables, including local. If you could see them, it was unintentional.

Anyway, thank you very much for your continues and valuable feedback. We have sent you a link for the private build 6.3.170. In this build the $OBJECT$ macro should be able to handle script variables. Please let us know if it is working correctly for you.
Mon Dec 03, 2012 1:31 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
SysOp wrote:
In previous releases $OBJECT$ macro was not designed to display any variables, including local. If you could see them, it was unintentional.

That's funny. I've been using that for a very long time.

SysOp wrote:
Anyway, thank you very much for your continues and valuable feedback. We have sent you a link for the private build 6.3.170. In this build the $OBJECT$ macro should be able to handle script variables. Please let us know if it is working correctly for you.


To be honest, there's only one snippet that uses it. Whenever I have to run dynamic SQL that is generated by code I like to see what has been generated before it is run, be it an ad-hoc query or a stored procedure. In MSSQL 2k8, PRINT developed the very bad habit of truncating its output to 8000 character for non-Unicode and 4000 characters for Unicode input. Sometimes a dynamic sql is longer than that and the laziness of PRINT makes debugging harder. Therefore I made this snippet:
Code:
DECLARE   
   @multi_print_counter INT = 1

WHILE   @multi_print_counter < LEN($OBJECT$)
BEGIN
   PRINT SUBSTRING($OBJECT$ ,@multi_print_counter , 4000)
   SET @multi_print_counter += 4000
END

It was crude but it worked so I began using it whenever there was a VARCHAR(MAX) or an NVARCHAR(MAX) type variable involved. Now this snippet is still broken, eg. I'm able to select '@stmt' from the popup but the result still does not contain the selected variable:
Code:

DECLARE   
   @multi_print_counter INT = 1

WHILE   @multi_print_counter < LEN()
BEGIN
   PRINT SUBSTRING( ,@multi_print_counter , 4000)
   SET @multi_print_counter += 4000
END

Tue Dec 04, 2012 5:00 am 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.