View previous topic :: View next topic
|
Author |
Message |
arraiyan.parveen Warnings : 1 New User
Joined: 10 Feb 2010 Posts: 5 Location: chennai
|
|
|
|
Hi! Can anyone tell me on how to convert spaces, low values, high values on alphanumeric fields to asterisks using a case statement in the select query.
suppose in the below query the CLIENT_ID field is alphanumeric
SELECT WH_BUS_DT
,CLIENT_ID
,ACCT_NUM
FROM TABLE1 |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
no need to use a CASE statement, read about REPLACE |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
So what have you found out about the syntax of the case statement? There should be plenty of examples lying around, too.
Have you then tried it yourself? |
|
Back to top |
|
|
arraiyan.parveen Warnings : 1 New User
Joined: 10 Feb 2010 Posts: 5 Location: chennai
|
|
|
|
The tech spec given to me states that i should use CASE statement to achieve this. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
arraiyan.parveen wrote: |
The tech spec given to me states that i should use CASE statement to achieve this. |
Well, for heaven's sake, do not question the tech spec.
replace(replace(replace(col,' ','*'),x'00',' '),x'FF','*')
could possibly work.
but, wait for someone to provide you with a CASE statement
to satisfy your requirement,
thus avoiding the problem of telling the cretin, who wrote the specs,
that his db2 skill level approaches yours. |
|
Back to top |
|
|
|