SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[7.0.132 beta] $OBJECTS$ + $COLUMNS$ anomaly

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[7.0.132 beta] $OBJECTS$ + $COLUMNS$ anomaly
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post [7.0.132 beta] $OBJECTS$ + $COLUMNS$ anomaly Reply with quote
A weird anomaly occurs when mixing the new multi-column capable $OBJECTS$ macro with the $COLUMNS$ macro. I had the following (fully functioning macro):
Code:

UPDATE   u
SET
   u.|
FROM   
   $OBJECT(ins_qualname, table,view,database)$ AS u
WHERE
   1 = 1   
   "AND u."$COLUMNS(vertical,keys)$" = "


Invoking it on Boxes table (a table with two-column composite primary key, colums ControllerId and BoxNumber being the key columns) I got the more or less expected result of:
Code:

UPDATE   u
SET
   u.
FROM   
   iqkeyserver.Boxes AS u
WHERE
   1 = 1   
    u.ControllerId =
   AND u.BoxNumber =


So I gave it a try and changed the original snippet to:
Code:

UPDATE   u
SET
   "u."$OBJECT(ins_column, table, view, column)$" = "
FROM   
   $OBJECT(ins_qualname, table,view,database)$ AS u
WHERE
   1 = 1   
   "AND u."$COLUMNS(vertical,keys)$" = "


Now invoking that on the same table the result is:
Code:

UPDATE   u
SET
   "u."ControllerId, BoxNumber" = "
FROM   
   iqkeyserver.Boxes AS u
WHERE
   1 = 1   
    u.ControllerId =
   AND u.BoxNumber =


which was not the best guess, because the $COLUMNS$ macro side-effected the $OBJECT(ins_column...)$ by constraining it to only show the key columns instead of pasting them all. When it was executed by selecting a single desired column (that is, BoxMaxKeyPositions, a non-key column) the result was worse by far. It complained about being unable to find key columns in the column itself:
Code:

UPDATE   u
SET
   "u."/* Cannot find key columns in iqkeyserver.Boxes.BoxMaxKeyPositions */" = "
FROM   
   iqkeyserver.Boxes AS u
WHERE
   1 = 1   
   /* Cannot find key columns in iqkeyserver.Boxes.BoxMaxKeyPositions */




Last edited by gemisigo on Wed Jul 02, 2014 1:49 am; edited 1 time in total
Tue Jul 01, 2014 7:30 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
Thank you. I have entered this issue into our issue tracking system
Tue Jul 01, 2014 9:14 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.