Sybase SQL Anywhere Version 11.0.1.2044
I have a table column delcared as TEXT (varchar) and marked as NOT NULL. If I attempt to save an empty string in this column, the following error is emitted:
> com.servoy.j2db.dataprocessing.DataException: SQL Anywhere Error -195: Column 'user_name' in table 'user_record' cannot be NULL
Validation failed for 'user_name', with value:
Wrapped java.lang.IllegalArgumentException: Validation failed for 'user_name', with value:
Here is the code that causes the error message:
- Code: Select all
var fs = databaseManager.getFoundSet( 'arm_data', 'user_record' )
fs.loadAllRecords()
var newRecord = fs.getRecord( fs.newRecord() )
newRecord.user_name = ''
databaseManager.saveData( newRecord )
The Sybase document (http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.blocks/html/blocks/blocks258.htm) states the following for SQL Error -195:
You have not supplied a value where a value is required. The column definition prohibits NULL values or the column is part of a NOT NULL foreign key.
It appears that a NULL is being passed to SQL Anywhere, but it should be an empty string value. Would someone be kind enough to explain to me what is happening?
Thanks!