Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

concatenate the case statement if possible

896976Sep 26 2012 — edited Sep 26 2012
I wahnt to use this query to create a view
 
select 
SPBPERS_PIDM,   
decode(SPBPERS_ETHN_CDE,'2','H'),
decode(SPBPERS_CITZ_CODE,'N','I'),
GORPRAC_RACE_CDE,
substr(GORRACE_DESC,1,1),
(case GORPRAC_RACE_CDE
 when    '2' then 'N'  
when   '3' then 'A'
when   '4' then 'B'
when   '5' then 'P'
when   '6' then 'W'
else 
null 
end)
from 
GORPRAC,
gorrace, 
spbpers 
where 
GORPRAC_RACE_CDE = GORRACE_RACE_CDE
and spbpers_pidm = GORPRAC_pidm
I would like to know if it is posible to concatenate all these values
 
(case GORPRAC_RACE_CDE
 when    '2' then 'N'  
when   '3' then 'A'
when   '4' then 'B'
when   '5' then 'P'
when   '6' then 'W'
so I can store in one column
The view I created display the data like this
SZNOLRAC_PIDM	SZNOLRAC_RACE_CDE	SZNOLRAC_DESC	SZNOLRAC_CODE
134524	2	A	N
134524	3	A	A
134524	4	B	B
134524	5	N	P
134524	6	W	W
I would like something like like thiso in one column
 
2AN3AA4BB5NP6WW 
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 24 2012
Added on Sep 26 2012
2 comments
3,459 views