Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: sql join
Chris;
The join you have defined (if I interpret your request correctly) is not needed.
The update should read:
update Mytable set new_ID = ID_let || ID_num ;This will change every row in the table.
You could use a view if the import is into the other product. This would look some thing like:
CREATE VIEW Mytable_view AS SELECT ID_let || ID_num new_ID, [other cols]
from mytable ;
NOTE: if you use the first option, you should set up a before insert or update trigger to keep teh new_ID column in sync.
HTH
James
In article <6mbak9$j67$1_at_nnrp1.dejanews.com>, chris_at_ultramedia.co.uk wrote:
>Hi,
>
>I have a table where the primary key is made up from
>ID_let - char(1) *and* ID_num - number(3)
>e.g. R57, R34, S57, T23
>
>...in order to use a particular product they require 1 single primary key
>to enable import (they are unable to join)....
>
>is it possible to create a field that is implemented in the same way
>as a spreadsheet...i.e. it always takes the values of other fields..even
>if they are updated?
>
>Failing that, I have created the extra field..but how do I do the following
> update Mytable
> set new_ID =
> select (char_key1 + num_key2)
> from othertable;
>
>cos that doesn't work :-(
>
>TIA
>
>Chris - chris_at_ultramedia.co.uk
>------------------------------
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/ Now offering spam-free web-based newsreading
--
lorenzen_at_tiny.net | Life is complex; it has | real and imaginary partsReceived on Thu Jun 18 1998 - 13:04:56 CDT