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

Home -> Community -> Usenet -> c.d.o.server -> creating unique text values?

creating unique text values?

From: Sebastian Scholz <e9926043_at_student.tuwien.ac.at>
Date: Sun, 26 Aug 2001 12:18:09 GMT
Message-ID: <3b88d4ce.3438103@news.tuwien.ac.at>


Hello,

I've got a simple Table, TEST, which has one Column A of Type varchar(255).

It could look like this:

A



B
B
B
B
E
E
G

Now, I would like to make each Value unique by simply adding Spaces to the right as needed.
So it should look like:

A



B
B_
B__
B___

E
E_
G

Spaces are marked with '_'.

I tried:

UPDATE TEST a SET a.A = RPAD(a.A,
(LENGTH(a.A)+
(SELECT COUNT(*) FROM TEST b WHERE b.A=a.A) - 1) );

but get:

Error in Line2:

ORA-00904: invalid column name

  1. Why do I get this Error and
  2. Is there another Solution for this?

Thanks,

Sebastian Received on Sun Aug 26 2001 - 07:18:09 CDT

Original text of this message

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