Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> I hate this

I hate this

From: bgt0990 <btighe_at_neometrics.com>
Date: Fri, 1 Nov 2002 15:18:58 -0500
Message-ID: <3dc2dcf7$1_1@corp-goliath.newsgroups.com>


What should be a simple update is driving me bonkers!

I am trying to add the 2 digit year prefix into an existing table field of CHAR (11). This table already has old 9 digit characters/numbers with a 2 digit date prefix portion as well as 11 digit numbers/characters.

The update statement I'm using works on the 9 digit numbers, adding the 2 digits nicely, however the stament nulls out any existing 11 digit numbers. The original statement had more logic in it but in essence this statement doesn't work.

update bgt.bgt2 a

set a.labno = (select '19'||trim(b.labno) from bgt.bgt2 b

where length(trim(b.labno))= 9 and a.labno = b.labno)

Can anyone point me correctly?

Barry

-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------

   http://www.newsfeed.com The #1 Newsgroup Service in the World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =----- Received on Fri Nov 01 2002 - 14:18:58 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US