View previous topic :: View next topic
|
Author |
Message |
arraiyan.parveen Warnings : 1 New User
Joined: 10 Feb 2010 Posts: 5 Location: chennai
|
|
|
|
How are low values and high vlaues stored in table for Alphanumeric field
for eg : FRST_NM CHAR(15)
what is the value to be given for this field to test if this field has low values or high vlaues |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you really need to do some reading.
this (and other subjects) are part of fundamental knowledge base
that you should have before you even start a job in computers.
high-value(s) and low-value(s) are COBOL figurative constants
and represent the internal storage of Hexidecimal X'FF' and X'00' respectively.
a column with datatype character can contain any of the 256 ebcdic hexidecimal values
(or 512 when the db2 is configured for UTF)
the test of a char column's value is the same regardless of the value being tested.
now, can you code in sql WHERE COL = Low-values
NO
but you can code your sql WHERE COL = :host-variable (where the HV contains low-values)
or WHERE COL = x'000000000000000000000000000000'
there are other syntax available, but suggest you find them yourself in the manuals,
hyperlinks (buttons) at the top of the page. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
this post appears to be the same as:
www.ibmmainframes.com/viewtopic.php?p=252559&highlight=#252559
and this:
ibmmainframes.com/viewtopic.php?t=51864
experience has shown that multibyte fields can often contain
1 low-value or high-value char and then spaces.
1st you need to determine if the complete 15 char are all binary zeroes,
binary 'FF' or spaces.
if the answer to that interrogation of the DB is true,
you can use the
x'000000000000000000000000000000' ,
x'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF' ,
and ' ' literals in your case statement.
but, if there is a combination of low-values/high-values and spaces
you case statement will not hold true.
your example in the locked topic where you provide your own case solution shows that the resulting value to be 1 char *.
now, when you have an accurate and complete description of the possible values and the required results, reply and someone will provide you with a solution. |
|
Back to top |
|
|
|