I'm trying to do something like:
SET @xml.modify ('insert <@x)>@y into (/something)[ID="@id"][1]')
I figured out when I replace @y with {sql:variable("@y")}, it worked. But it doesn't work for @x.
Is there a way to make it work?
I'm trying to do something like:
SET @xml.modify ('insert <@x)>@y into (/something)[ID="@id"][1]')
I figured out when I replace @y with {sql:variable("@y")}, it worked. But it doesn't work for @x.
Is there a way to make it work?
Copyright © 2021 Jogjafile Inc.
It is not possible to insert an element with a dynamic name. Look at these examples:
Easy going, everything fixed literals
The result
Dynamic content
The result
This is not allowed and will lead to an error
But you can create the full XML-element externally and insert it as-is
The result
This would lead to the same result
And this - fully parameterised - would also return the same