db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernt M. Johnsen" <Bernt.John...@Sun.COM>
Subject Re: Update Substring of a field
Date Wed, 02 Apr 2008 08:14:36 GMT
>>>>>>>>>>>> Reginald Johnson wrote (2008-03-30 00:48:33):
> Is it possible to update the substring of a field?  I'm trying to do
> something like this:
> 
> UPDATE tblIntervals SET SessionMouseID = 'ggg',  substr(SessionID, 0, 3) =
> 'ggg' WHERE SessionMouseID = 'bbb'

Neither Derby, nor the SQL standard supports a substring expression on
the left side of the assignment.

Your options is to eiher do it in java through JDBC, or modify your
schema to store SessionMouseID and e.g. SessionIDRest and do a
concatenation each time you need a SessionID. Don't know if the latter
is feasible in your case, though.

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

Mime
View raw message