PL/SQL查询条件中使用like操作实例
程序员文章站
2022-03-09 22:18:33
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;
上一篇: yii2.0使用Plupload实现带缩放功能的多图上传
下一篇: PL/SQL基本语法结构及案例