Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 7499 invoked from network); 2 Apr 2008 08:15:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Apr 2008 08:15:11 -0000 Received: (qmail 2658 invoked by uid 500); 2 Apr 2008 08:15:10 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 2626 invoked by uid 500); 2 Apr 2008 08:15:10 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 2615 invoked by uid 99); 2 Apr 2008 08:15:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2008 01:15:10 -0700 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [192.18.98.31] (HELO brmea-mail-1.sun.com) (192.18.98.31) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2008 08:14:18 +0000 Received: from dm-norway-02.uk.sun.com ([129.156.101.226]) by brmea-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m328EbYs016651 for ; Wed, 2 Apr 2008 08:14:37 GMT Received: from clustra.norway.sun.com (clustra.Norway.Sun.COM [129.159.119.10]) by dm-norway-02.uk.sun.com (8.13.6+Sun/8.13.6/ENSMAIL,v2.2) with SMTP id m328Ea8O006520 for ; Wed, 2 Apr 2008 09:14:37 +0100 (BST) Received: (qmail 5730 invoked from network); 2 Apr 2008 08:14:36 -0000 Received: from khepri35.norway.sun.com (129.159.112.247) by clustra.norway.sun.com with QMQP; 2 Apr 2008 08:14:36 -0000 Date: Wed, 2 Apr 2008 10:14:36 +0200 From: "Bernt M. Johnsen" To: Derby Discussion Subject: Re: Update Substring of a field Message-ID: <20080402081436.GE4586@khepri35.norway.sun.com> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9UV9rz0O2dU/yYYn" Content-Disposition: inline In-Reply-To: Organization: Sun Microsystems User-Agent: Mutt/1.5.7i X-Virus-Checked: Checked by ClamAV on apache.org --9UV9rz0O2dU/yYYn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable >>>>>>>>>>>> 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: >=20 > UPDATE tblIntervals SET SessionMouseID =3D 'ggg', substr(SessionID, 0, 3= ) =3D > 'ggg' WHERE SessionMouseID =3D '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. --=20 Bernt Marius Johnsen, Database Technology Group,=20 Staff Engineer, Derby/Java DB Sun Microsystems, Trondheim, Norway --9UV9rz0O2dU/yYYn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (SunOS) iD8DBQFH80BslFBD9TXBAPARAveLAKCUJeYr4eP4SopddgJpq7c/8p3LfQCdHzRt RVg2TeB7Pr/cgbJo9QCFwNs= =IFCa -----END PGP SIGNATURE----- --9UV9rz0O2dU/yYYn--