A few days ago, Alexander Barkov pushed some changes to the MySQL
5.1 tree that I’ve been waiting to see for some time — variable
support for XPath functions used with ExtractValue()
and UpdateXML(). (This was a fix for Bug
#26518, BTW.) This will be available in MySQL 5.1.20 (or grab the MySQL 5.1 source from
bkbits and build it yourself, if you just can’t wait).
Two slightly different notations are supported, depending on the context, and what sort of checking you want done on the values:
- If you don’t want or need type checking, prefix the variable
name with
$@, like this:$@myvar. However, if you do this, and you make a typo, you’re on …