Forum Discussion
majorbyte
9 years agoIdeator III
Thanks for your response, Zahar.
Our SQL instance is case-insensitive, so the second where works as it should, if I run the <item> inside the datasource on its own, it returns:
But I get the feeling that AML can't cope with nested where statements. I'm missing something but I can't put my finger on it.
<Result>
<Item type="Property" typeId="26D7CD4E033242148E2724D3D054B4D3" id="07912B9CE3374ABFAACF1B19B3F6F718">
<id keyed_name="locked_by_id" type="Property">07912B9CE3374ABFAACF1B19B3F6F718</id>
</Item>
</Result>
I'm aware as well about the first where, but currently we only have one property with that name.
I'm trying to achieve:
UPDATE innovator.[PROPERTY]
SET DATA_SOURCE = (
SELECT [PROPERTY].id id
FROM innovator.[PROPERTY]
WHERE keyed_name = 'locked_by_id' AND [Property].source_id in (select IT.ID from innovator.ITEMTYPE IT where IT.name = 'Document') )
WHERE [Property].keyed_name = 'era_locked_by'