Hello!
I just want to add two elements on the same node using “do insert into” command of xquery method. Unfortunately I got the following error code:
–
Tamino Error 6451: Conflicting update operations (XQuery Update Request processing) (Trying to perform two InsertInto operations against the same node.)
–
In my database I have got the data:
Atkins
Paul
Male
…
I just want to have the following data:
Atkins
Paul
J.
Prof.
Male
…
How should I fix my source code?
In advance, thanks a lot!
best regards,
Dariusz Baumann
PS.
Here is code:
-----------------
<?php
header("Content-Type: text/html; charset=UTF-8");
include "TaminoAPI.php";
include "TaminoHelperFunctions.php";
$PC_HOST = "localhost";
$PC_PORT = "80";
$PC_DATABASE = "mydb";
$PC_COLLECTION = "Hospital";
$PC_DOCTYPE = "patient";
$PC_ENCODING = "UTF-8";
$PC_USERNAME = "";
$PC_PASSWORD = "";
$tamino = &new TaminoAPI($PC_HOST,
$PC_PORT,
$PC_DATABASE,
$PC_USERNAME,
$PC_PASSWORD);
$tamino->setCollection($PC_COLLECTION);
$tamino->setEncoding($PC_ENCODING);
$surname = "Atkins";
$middlename = "J.";
$title = "Prof.";
$xquery = "update for \$a in input()/$PC_DOCTYPE ".
"where \$a/name/surname = \"$surname\" ".
"do ".
"(".
"insert $middlename into \$a/name ".
"insert $title into \$a/name ".
")";
if (!($tamino->xquery($xquery)))
{
echo "ERROR
";
thfPrintError($tamino);
}
else
{
echo "OK.
";
}
?>
-----------------
#API-Management#Tamino#webMethods