webmethods oracle issue with nchar

118 views Asked by At

When I try to do a "Select" statement using a data type "nChar" into the where column I must pad the input value before passing it into the input value of the adapter. This happens mainly because the nchars in oracle have a fixed length. I would like to know if there is a way to bypass this behavior so that i can retrieve, for example, record like this: supposing that name is an nchar(8) column

select surname from people where name='joe'    

instead of be obliged to do

select surname from people where name='joe     '

This is my environment: WebMethods 9.7 Adapter 9.0 ojdbc7

1

There are 1 answers

4
Rahul On

Either you change your column data type to NVARCHAR(8) or use a LIKE operator as

where name like 'joe%'

(OR) use TRIM() function like

where TRIM(name) = 'joe'

(OR) use RPAD() function like

where name = RPAD('joe',8, ' ');