Hi

I am trying to update a table containing a column named StreamData defined
as %GlobalCharacterStream via an UPDATE command, and it doesn't seem to be
working.

I am using the code shown in the docs on

http://127.0.0.1:1972/csp/docbook/DocBook.UI.Page.cls?KEY=GOBJ_streams#GOBJ_
C2402

as below:

 s serStr = ##class(%GlobalCharacterStream).%New()
...
 do serStr.SaveStream()

// +MAGIC
// Now record the stream oref in the %qstrhandle structure
s %qstrhandle(1, serStr) = serStr
// Turn stream into a string representation of an oref
s serStr = serStr_""
&sql(update APIX.Storage set StreamData = :serStr where dbID = :dbID)
// Close the stream when we are done
k %qstrhandle(1, serStr)
// -MAGIC

This does not appear to be working - if I try to do SELECT * from the table
(which has just one row which meets the where clause for the update) then I
get the following error in my SQL Query Tool.

[SQLCODE: <-412>:<General Stream Error>]
[Cache Error: <<LIST>%Open+1^%ooLibrary.SerialStream.1>]
[Details: <StrErr>]
State:S1000,Native:412,Origin:[Cach� ODBC][State : S1000][Native Code 412]

Doing just a SELECT dbID works OK, and I can see the ID and dbID values for
the one row.

Has anyone any ideas?

TIA

Richard





Reply via email to