when I am using SQL%ROWCOUNT, it returns the count = 1 though there is no record from PRODUCT table for the condition
SELECT count(*) into v_count FROM PRODUCT WHERE LOC = v_oldloc;
dbms_output.put_line('Records found in PRODUCT table for column LOC with value '|| v_oldloc ||':'|| SQL%ROWCOUNT );
COMMIT;
But, When i use the v_count to display the count of records , it returns ZERO (correct value) as below
SELECT count(*) into v_count FROM PRODUCT WHERE LOC = v_oldloc;
dbms_output.put_line('Records found in PRODUCT table for column LOC with value '|| v_oldloc ||':'|| v_count );
COMMIT;
Please let me know if there is any problem with the code?
Thanks in advance