problem using transactional updatde

hello to everyone,

I am trying to update a record inside a collection (vb api, version; tamino 4.1.4).
If I use a non transactional sequence, like:


---------------------------------------------

Dim url As String
Dim TamX2 As Object
Dim myerrcode As Long
Dim myerr As Variant
Dim queryResponse As Object
Set TamX2 = CreateObject(“TaminoX.TaminoX1”)
Call TamX2.Initialize
TamX2.lpagesize = 0
url = “http://legolas/tamino/HSRDBprod/tables
TamX2.csDatabaseURL = url
Dim stringaquery as string
stringaquery = "update for $e in input()/reportobj[@id=‘23’]/report " & _
“let $r := do replace $e/@changedate with $r/@changedate

Set queryResponse = TamX2.XQuery(stringaquery)

myerrcode = TamX2.getErrorStatus(myerr)
If myerrcode = 0 Then
msgbox(“OK”)
Else
msgbox(“KO”)
End If
Set doc = Nothing
Set TamX2 = Nothing

---------------------------------------------


everything works fine, but if I use the following (transactional) procedure:

---------------------------------------------


Dim url As String
Dim TamX2 As Object
Dim myerrcode As Long
Dim myerr As Variant
Dim queryResponse As Object
Set TamX2 = CreateObject(“TaminoX.TaminoX1”)
Call TamX2.Initialize
’ we tried different positions of the
’ pagesize setting, in order to deactivate cursoring
TamX2.lpagesize = 0

url = “http://legolas/tamino/HSRDBprod/tables
TamX2.csDatabaseURL = url
Dim stringaquery as string
stringaquery = "update for $e in input()/reportobj[@id=‘23’]/report " & _
“let $r := do replace $e/@changedate with $r/@changedate

Set doc = TamX2.StartSession(4, 2)
Set queryResponse = TamX2.XQuery(stringaquery)

myerrcode = TamX2.getErrorStatus(myerr)
If myerrcode = 0 Then
Set doc = TamX2.Commit
msgbox(“OK”)
Else
Set doc = TamX2.RollBack
msgbox(“KO”)
End If
Set doc = TamX2.endsession
Set doc = Nothing
Set TamX2 = Nothing


---------------------------------------------



I have the following error:

code: 8552
text: Not a valid request. It is not possible to open a cursor with XQuery Update Request.


The problem is that, according to my knowledge, the cursor should be deactivated setting the pagesize to 0.
I tried different positions of the pagesize setting instruction
(immediately after the init, after the url definition and so on), but it did not work.

any Idea?

The XQuery method is for pure XQuery requests.

The Update method is for XQuery update requests.

Hopefully that should sort out your problem.

Thanks Mark.
It works.

Simply, it was not so clear from the documentation that (just in the transactional case…) I had to use a different interface method of the activex object.