Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am trying to determine why my exception output is not returning correctly. This is for Oracle SQL Developer, practicing with PL/SQL. I can provide
I am trying to determine why my exception output is not returning correctly.
This is for Oracle SQL Developer, practicing with PL/SQL. I can provide the table code if requested.
SET serveroutput on CREATE OR REPLACE Procedure GetPermissions(user IN VARCHAR, docNum OUT INTEGER) IS BEGIN SELECT count(*) INTO docNum FROM UserPermissions where UserName=user; EXCEPTION WHEN NO_DATA_FOUND THEN dbms_output.put_line('Nothing found for this username'); END; / DECLARE doc_count INTEGER; BEGIN doc_count:=0; GetPermissions('Steve', doc_count); dbms_output.put_line(' Number of documents: ' || doc_count); END; /
I am expecting the exception exception to return its output (nothing found) when 'Steve' is ran through as that is not a username in the table I created. When running currently is just shows "Number of documents: 0".
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started