I have a question from one of our SQL Engineers...
Does Sybase SQL engine support the .WRITE syntax for updating a specified section of a varbinary column as TSQL (MS SQL Server) does
i.e. UPDATE [mytable] SET Data .WRITE (@buffer, @start, @length) WHERE ….
Or is there some other way of achieving the same basic outcome?
asked 31 Jan '13, 02:42
What about the STUFF string function, such as - assuming @buffer is a string variable containing the new data portion:
UPDATE myTable SET myColumn = STUFF(myColumn, @start, @length, @buffer) WHERE myPK = ...;
AFAIK, all SQL Anywhere string functions will handle binary data, too, and do so without character conversion (whereas that will happen to character data as desired).
Aside: IIRC, SQL Anywhere had never those funky special datatypes like TEXT/IMAGE and their not-so-internal usage of "text pointers" for BLOBs and CLOBs which require special handling in MS SQL Server and ASE (WRITETEXT, UPDATETEXT and the like). In SQL Anywhere, a LONG VARCHAR or LONG VARBINARY can use up to 2 GB of data and are treated (with minor exceptions) much like ordinary strings.
answered 31 Jan '13, 04:07