关于字符串的in中使用
declare
v_str varchar2(32767);
v_num number;
begin
v_str := '''124''';
v_str := v_str || ',';
v_str := v_str || '''B737-700''';
select count(*) into v_num from item where itemnum in (v_str);
dbms_output.put_line(v_str|| ' ' ||v_num);
end;
输出结果:'124','B737-700' 0
说明v_str为'124','B737-700',而itemnum in (v_str)应该为itemnum in ('124','B737-700')
但是输出结果为空;
select count(*) into v_num from item where itemnum in ('124','B737-700');
这个结果为2