The STRING_TAB table has the following structure:
View the Exhibit and examine the code.
What is the outcome on execution?
A. It displays
Output buffer not long enough.
This is my test string.-.
B. It displays only
Output buffer not long enough, and exits the anonymous block.
C. It displays only
This is my test string. – Because EXCEPTION should have been defined in the anonymous block to get the error message.
D. It does not display any of the MEMS_PUTPUT messages and gives an error because a transaction control statement cannot be used in the exception section of a procedure.
adding….
Output buffer not long enough.
This is my test string. –
PL/SQL procedure successfully completed.
set serveroutput on
/
declare
in_string varchar2(25) := ‘This is my test string.’;
out_string varchar2(25);
procedure double(original in varchar2, new_string out varchar2) is
begin
new_string := original || ‘ + ‘ || original;
exception
when value_error then
dbms_output.put_line(‘Output buffer not long enough.’);
commit;
end;
begin
double(in_string, out_string);
dbms_output.put_line (in_string || ‘ – ‘ || out_string);
end;
/
I also think that correct answers are A;
SQL> set serveroutput on
SQL> declare
2 in_string varchar2(25) := ‘This is my test string.’;
3 out_string varchar2(25);
4 procedure double(original in varchar,
5 new_string out varchar2) is
6 begin
7 new_string := original || ‘ + ‘ || original;
8 exception
9 when value_error then
10 dbms_output.put_line(‘Output buffer not long enough.’);
11 commit;
12 end;
13 begin
14 double(in_string,
15 out_string);
16 dbms_output.put_line(in_string || ‘ – ‘ || out_string);
17 end;
18 /
Output buffer not long enough.
This is my test string. –
PL/SQL procedure successfully completed
SQL>