PL / sql游标没有输出以下代码

时间:2012-04-13 14:31:10

标签: plsql cursor

set serveroutput on;
declare
temp_id applicant.id%type;
cursor c1 is select id from applicant where father like 'xyz';
begin
if not c1%isopen then open c1;
end if;
loop
fetch c1 into temp_id;
dbms_output.put_line(temp_id);
exit when c1%notfound;
end loop;
close c1;
end;
/

我有一个带有id列的表格申请人。我认为光标不会取任何东西。虽然程序成功完成。在父亲喜欢'xyz'的情况下是否有错误?

1 个答案:

答案 0 :(得分:0)

请从申请人那里尝试这个选择ID,其中父亲喜欢'%xyz%&#39 ;; ,我不知道为什么你这样做,如果你不想使用类似的主要功能,我的意思是使用%。如果你想要父亲的名字应该是xyz,那么试试父亲=' xyz&#39 ;而不是父亲喜欢' xyz'

相关问题