Skip to Content
0
May 18, 2004 at 10:28 AM

Assigning Empty Strings to String Field Throws OpenSQLException

37 Views

Hi there,

I have defined a DB table with different fields, one of these is field COMMENT, type set to string, Dim to 1024, that means real type Varchar (when controlling via SQL Studio; within the DDIC Project in Netweaver Developer Studio, it says LONGVARCHAR for being bigger than 1000 chars), code is UNICODE, Not Null not set.

When I insert a row and there is no comment, an empty string is set for COMMENT. But this throws a com.sap.sql.log.OpenSQLException: Cannot assign an empty string to host variable

Why this?

When I control the string before and set the field to null instead of the empty string, it "works". (But that's definitely ugly).

Thanks in advance

Detlev