默认的字符集和排序规则是latin1和latin1_swedish_ci,因此非二进制字符串比较在默认情况下不区分大小写。这意味着如果使用col_name LIKE 'a%'进行搜索,将得到所有以a或a开头的列值。要使此搜索区分大小写,请确保其中一个操作数具有区分大小写或二进制排序规则。例如,如果比较的列和字符串的字符集都为latin1,可以使用COLLATE操作符使其中一个操作数的排序规则为latin1_general_cs或latin1_bin:
col_name COLLATE latin1_general_cs LIKE 'a%'
col_name LIKE 'a%' COLLATE latin1_general_cs
col_name COLLATE latin1_bin LIKE 'a%'
col_name LIKE 'a%' COLLATE latin1_bin
SET pSignal =
(SELECT DECODE(r.usignal,'YOURSTRINGKEY') FROM rsw_uds r WHERE r.uname =
in_usdname AND r.uvige = 1);
SET pSuccess =(SELECT in_usdsignal LIKE BINARY pSignal);
IF pSuccess = 1 THEN
/*Your code if match*/
ELSE
/*Your code if don't match*/
END IF;