Symptom

When executing an UpdateBlob on a proxy table, no data is written in the database.

Environment

Powerbuilder
Database ASE 15.0

Reproducing the Issue

- Connect PowerBuilder to an ASE database DB1
- On a second database DB2, create a table blobtable with columns 
    (id numeric(18,0) identity, description varchar(128) not null, xblob text null) 
- Create a link from DB1 to DB2
- From PowerBuilder, insert in blobtable a new row ( 1, "First Row")
- Now put a blob in column xblob using :
    UPDATEBLOB blobtable SET xblob = :lb WHERE id = 1; 
    commit;
    MessageBox ("UpdateBlob returns :", Sqlca.SqlErrText)

The error "NULL textptr passed to WRITETEXT function." is displayed

Cause

This problem is due to the fact that the blob column is null after inserting a new row.
If the column is not null, UpdateBlob works fine with a proxy table.

Resolution

Before updating the blob column, initialize the blob column with an empty string:
    UPDATE blobtable SET xblob = '' WHERE id = :ll_id ;
    commit;

0
0