No cast from text to lvarchar
Posted in 2009
Hi im in a .net odbc connection to an IDS 11.50.UC4
Client is 3.00 3.00 TC3 in a Windows Server 2003
I have a column in a table of type LVARCHAR like this:
iconobase64 lvarchar(16384)
I set from client and update command:
UPDATE CorporateMenuElements SET actualizado = ?, iconobase64 = ?
WHERE menuid = ?
And add the Parameter for the lvarchar of type (i try all this):
NVARCHAR, VARCHAR, TEXT (OdbcType enumeration of ADO.NET)
with a parameter value of 2984 bytes works well.
With a parameter of 5716 bytes i get:
ERROR [HY000] [Informix][Informix ODBC Driver][Informix]No cast from
text to lvarchar.
I read this from IBM site, but dont seems to fit in my case:
Using Visual Basic Client-side Cursors
When you use Visual Basic client side cursors to perform rowset update
related operations using CHAR or LVARCHAR columns with lengths greater
than or equal to 16,385, the IBM® Informix ODBC Driver might return an
error.
Visual Basic sends the SQL data type to SQLBindParameter as
SQL_LONGVARCHAR instead of SQL_VARCHAR when the length is greater than
or equal to 16,385. IBM Informix ODBC driver maps SQL_LONGVARCHAR to
TEXT data type. Therefore, applications might see the error:
[Informix][Informix ODBC Driver]No cast from text to lvarchar
Can anybody help me to understand this and find some solution?
Thank you!