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

Updating a Long VarChar field

414 views
Skip to first unread message

Gustavo Brown

unread,
Aug 11, 2003, 2:44:55 PM8/11/03
to
Hi,
I'm having problems to update a LONG VARCHAR field.
Suppose I have a table with two fields (the key field named TheKey, and a
long varchar field, named LongVarChar)

I use this sql sentence for updation: UPDATE TEST SET LongVarChar='Test'
but I get the following message:

java.sql.SQLException: A blob data type must be supplied within this
context.
at com/informix/jdbc/IfxSqli.errorDone (IfxSqli.java)
at com/informix/jdbc/IfxSqli.receiveError (IfxSqli.java)
at com/informix/jdbc/IfxSqli.receiveMessage (IfxSqli.java)
...
...

Is there any way to do this update. I have tried to update in a row-by-row
basis, and it seems to work, but I want to update all the rows at once.
Am I missing something ? Any hints would be appreciated.

Regards,
G. Brown


Gustavo Brown

unread,
Aug 11, 2003, 3:28:04 PM8/11/03
to
When I said 'LONG VARCHAR' field I really meant 'TEXT field', i.e. the field
I am having trouble to update is a TEXT field.

Regards,
G.Brown

"Gustavo Brown" <alegusTakeOffThisA...@QuitThisToo.Now>
wrote in message news:bh8obm$m9$1...@newsreader.mailgate.org...

Jonathan Leffler

unread,
Aug 16, 2003, 7:25:53 PM8/16/03
to
Gustavo Brown wrote:

> When I said 'LONG VARCHAR' field I really meant 'TEXT field', i.e. the field
> I am having trouble to update is a TEXT field.


That's a big difference!

Fundamentally, there are no blob (BYTE or TEXT - or BLOB or CLOB)
literals. That is a pain (big pain), but so. It means your only
chance of getting it to work is to replace the SQL with:

UPDATE Test SET TextColumn = ?

You then have to supply the value of the TEXT column when you execute
the statement. You probably have to set it up, too. And at that
point, my limited knowledge of JDBC shows -- I don't know what the
steps are to create a BYTE or TEXT host variable are in Java/JDBC.

> Gustavo Brown wrote:
>> I'm having problems to update a LONG VARCHAR field.
>>Suppose I have a table with two fields (the key field named TheKey, and a
>>long varchar field, named LongVarChar)
>>
>>I use this sql sentence for updation: UPDATE TEST SET
>
> LongVarChar='Test'
>
>>but I get the following message:
>>
>>java.sql.SQLException: A blob data type must be supplied within this
>>context.
>> at com/informix/jdbc/IfxSqli.errorDone (IfxSqli.java)
>> at com/informix/jdbc/IfxSqli.receiveError (IfxSqli.java)
>> at com/informix/jdbc/IfxSqli.receiveMessage (IfxSqli.java)
>> ...
>> ...
>>
>>Is there any way to do this update. I have tried to update in a row-by-row
>>basis, and it seems to work, but I want to update all the rows at once.
>>Am I missing something ? Any hints would be appreciated.

--
Jonathan Leffler #include <disclaimer.h>
Email: jlef...@earthlink.net, jlef...@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/

0 new messages