Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
刚开始学习 PL/SQL 和游标属性。我对 SQL%NOTFOUND 的工作方式感到困惑。在下面的代码中,v_1 是否应该始终编译为 true?
DECLARE v_1 BOOLEAN; v_2 NUMBER; BEGIN SELECT count(*) INTO v_2 FROM t1; v_1 := SQL%NOTFOUND; END;
在这种情况下v_1应该总是FALSE. 所问的问题v_1 := SQL%NOTFOUND是“查询没有找到记录吗?”,答案是“否”(或FALSE),因为此查询将始终返回一行 - 因此,v_1将始终是FALSE。这是一种“双重否定”的情况。:-)
v_1
FALSE
v_1 := SQL%NOTFOUND
分享和享受。