Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Empty blob variables in UPDATEBLOB

257 views
Skip to first unread message

René Krell

unread,
Feb 13, 1998, 3:00:00 AM2/13/98
to

Powerbuilder 5.0, Sybase SQL Server 11:

I use the UPDATEBLOB embedded SQL statement as follows:

SetNull( lblob_image )

UPDATEBLOB tblname
SET ImageCol = :lblob_image
WHERE ID = :currentID ;

This results in an database error "blob variable may not be empty".
UPDATEBLOB prohibits a "SET ImageCol = NULL", too. How can I set a
database blob (image) column to NULL?

René


Ron Gallagher

unread,
Feb 13, 1998, 3:00:00 AM2/13/98
to

René --

I'm not sure, but a basic update, rather than an updateblob, may do the
trick.

string ls_Temp
SetNull( ls_Temp )

UPDATE tblname
SET ImageCol = :ls_Temp
WHERE ID = :currentID ;

HTH

Ron Gallagher, CPDP
Atlanta, GA, USA
rongal...@mindspring.com

Juan Bautista Nunez R.

unread,
Feb 13, 1998, 3:00:00 AM2/13/98
to

It looks like you forgot to specify the image column as accepting null
values. Check your table definition.

--
Juan Bautista Nunez R.
jbn...@usa.net

On Fri, 13 Feb 1998 12:00:17 +0100, René Krell says...

René Krell

unread,
Feb 16, 1998, 3:00:00 AM2/16/98
to

I tried the trick you suggested. The statement didn't result in a database
error or other bad return value ( dw.Update() ), but the UPDATE statement
had no effect. All other changes were made in database, which means the
COMMIT succeeded.

For other comments in this discussion group: The database column is
definitively allowed to be null.
WISQL, Sybase 11, "sp_colums tblname" returns
data_type = -4
type_name = image
precision = 2147483647
length = 16
scale = NULL
radix = NULL
nullable = 1

0 new messages