You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Wynne Crisman <wc...@declarativeengineering.com> on 2006/04/10 01:25:17 UTC

Problems assigning null to VARCHAR FOR BIT DATA types

Is it possible to assign a null value to a VARCHAR FOR BIT DATA column?  I
am getting the following exception from the derby driver:

SQL Exception: An attempt was made to get a data value of type 'VARCHAR ()
FOR BIT DATA' from a data value of type 'BLOB'.
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
Source)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
Source)
	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown
Source)
	at
org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
	at
org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
	at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.dataTypeConversion(Unknown
Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.setNull(Unknown
Source)

Anyone know if this is a bug or feature?  I am using the 10.1.2.1 version of
derby.

Thank you,
Wynne


Re: Problems assigning null to VARCHAR FOR BIT DATA types

Posted by Wynne <wc...@softwarezealot.com>.
That solved the problem.  Thank you,

Wynne


Re: Problems assigning null to VARCHAR FOR BIT DATA types

Posted by "Bernt M. Johnsen" <Be...@Sun.COM>.
>>>>>>>>>>>> Wynne Crisman wrote (2006-04-09 17:25:17):
> Is it possible to assign a null value to a VARCHAR FOR BIT DATA column?  I
> am getting the following exception from the derby driver:
>
> SQL Exception: An attempt was made to get a data value of type 'VARCHAR ()
> FOR BIT DATA' from a data value of type 'BLOB'.

Seems to me that you have done setNull(n, Types.BLOB) while you should
have done setNull(n, Types.BINARY)

-- 
Bernt Marius Johnsen, Database Technology Group, 
Staff Engineer, Technical Lead Derby/Java DB
Sun Microsystems, Trondheim, Norway