 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
[7.0.132 beta] $OBJECTS$ + $COLUMNS$ anomaly |
|
A weird anomaly occurs when mixing the new multi-column capable $OBJECTS$ macro with the $COLUMNS$ macro. I had the following (fully functioning macro):
 |
 |
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:
 |
 |
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:
 |
 |
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:
 |
 |
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:
 |
 |
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Thank you. I have entered this issue into our issue tracking system
|
|
Tue Jul 01, 2014 9:14 pm |
|
 |
|
|
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
|
|
|