PL/SQL查询条件中使用like操作实例
程序员文章站
2022-06-16 14:24:21
set serveroutput on
declare
type ref_trans is ref cursor;
tranref ref_trans;
v_trns emp%rowtype;
st...
set serveroutput on
declare
type ref_trans is ref cursor;
tranref ref_trans;
v_trns emp%rowtype;
str varchar2(200);
--v_channel varchar2(50);
letter char:= 'a';
begin
loop
str := 'select channel from bphadmin.emp where channel like '''||letter||'%''';
open tranref for str;
loop
fetch tranref into v_trns.channel;
exit when tranref%notfound;
dbms_output.put_line(v_trns.channel);
end loop;
exit when letter='z';
letter:= chr(ascii(letter)+1);
end loop;
end;
上一篇: Mysql 多主一从数据备份
下一篇: 百度称将为淘宝卖家开通绿色通道