database - PL/SQL value of a boolean after execution using SQL%NOTFOUND -
just started learning pl/sql , cursor attributes. confused how sql%notfound works. in below code should v_1 compile true @ times?
declare v_1 boolean; v_2 number; begin select count(*) v_2 t1; v_1 := sql%notfound; end;
in case v_1
should false
. question being asked v_1 := sql%notfound
"were there no records found query?", , answer "no" (or false
) because query return row - therefore, v_1
false
. it's kind of "double-negative" situation, kind of. :-)
share , enjoy.
Comments
Post a Comment