2

当我尝试使用数据类型“nChar”在 where 列中执行“Select”语句时,我必须先填充输入值,然后再将其传递到适配器的输入值中。发生这种情况主要是因为 oracle 中的 nchars 具有固定长度。我想知道是否有办法绕过这种行为,以便我可以检索,例如,这样的记录:假设该名称是一个 nchar(8) 列

select surname from people where name='joe'    

而不是必须做

select surname from people where name='joe     '

这是我的环境:WebMethods 9.7 Adapter 9.0 ojdbc7

4

1 回答 1

1

您可以将列数据类型更改为NVARCHAR(8)或使用LIKE运算符作为

where name like 'joe%'

(或)使用TRIM()类似的功能

where TRIM(name) = 'joe'

(或)使用RPAD()类似的功能

where name = RPAD('joe',8, ' ');
于 2015-06-25T13:43:22.600 回答