Andreas Joseph Krogh wrote:
> On 02/09/2011 01:20 AM, Kris Jurka wrote:
>> The problem is that we have no idea what someone might want to do with a
>> CLOB after they've fetched it. You're coming from the idea that all
>> they want to do is read it and copy the data out to a String. From that
>> perspective it's not hard to have a Clob wrapper around a String, but
>> what happens when they say clob.setString(13, "data")? Are we going to
>> try and figure out what row of what table that varchar column is coming
>> from and do a partial update on it?
> So, I think clob.setString(index, data) should behave just like
> StringBuilder.insert(int offset, String str) except overwrite existing
> data instead of moving the characters above the position.
You really missed Kris' point here - the question is not "how should we
modify the data?" but "how do we locate the data to modify in the first
place?". Consider:
SELECT somedatacolumn FROM sometable WHERE complex condition
Now you have a resultset with one column. It's a varchar. The caller
calls ResultSet.getClob().setString(). What does the driver do?
Synthesize an UPDATE statement? How? With what parameters?
Oliver