Which statement is true when the procedure DELETE_DETAILS is invoked?

View the exhibit and examine the structure of the products table.

Examine the following code

Which statement is true when the procedure DELETE_DETAILS is invoked?

View the exhibit and examine the structure of the products table.

Examine the following code

Which statement is true when the procedure DELETE_DETAILS is invoked?

A.
It executes successfully but no error messages get recorded in the DEBUG_OUTPUT table

B.
It executes successfully and any error messages get recorded in the DEBUG_OUTPUT table.

C.
It gives an error because PRAGMA AUTONOMOUS_TRANSACTION can be used only in
packaged procedures.

D.
It gives an error because procedures containing PRAGMA AUTONOMOUS_TRANSACTION
cannot be called from the exception section.

Explanation:
In this case, the debug output will only occur if there is an exception.



Leave a Reply 23

Your email address will not be published. Required fields are marked *


Vladimir

Vladimir

A

Because of SUBSTR(sqlerrm, 100)
Error Message is cutted off and this why “no error message was recorded”

Fabio

Fabio

It’s A because the delete will not raises any exception, so debug_output will never be invoked…

Balthazar

Balthazar

Still there is a possibility of recording error messages where sqlerrm> 100

Balthazar

Balthazar

Hence B is the correct answer

chunnu

chunnu

Correct Answer is A.

dudeman

dudeman

A. If there is an exception, then the debugging procedure will be called.

Alisa

Alisa

The AUTONOMOUS_TRANSACTION pragma changes the way a subprogram works within a transaction.

A subprogram marked with this pragma can do SQL operations and commit or roll back those operations, without committing or rolling back the data in the main transaction.

An autonomous transaction is an independent transaction that is initiated by another transaction, and executes without interfering with the parent transaction. When an autonomous transaction is called, the originating transaction gets suspended. Control is returned when the autonomous transaction does a COMMIT or ROLLBACK.
A trigger or procedure can be marked as autonomous by declaring it as PRAGMA AUTONOMOUS_TRANSACTION;. You may need to increase the TRANSACTIONS parameter to allow for the extra concurrent transactions.

Alisa

Alisa

C is incorrect.

A trigger or procedure can be marked as autonomous by declaring it as PRAGMA AUTONOMOUS_TRANSACTION

D is incorrect.

If an autonomous transaction attempts to access a resource held by the main transaction (which cannot resume until the autonomous routine exits), a deadlock can occur. Oracle raises an exception in the autonomous transaction, which is rolled back if the exception goes unhandled.

Alisa

Alisa

C is incorrect bc this pragma can be applied to stand alone procedures, and not just packaged procedures

Alisa

Alisa

The syntax for the SUBSTR function in Oracle/PLSQL is:

SUBSTR( string, start_position [, length ] )

SUBSTR(‘This is a test’, 6, 2)
Result: ‘is’

SUBSTR(‘This is a test’, 6)
Result: ‘is a test’

SUBSTR(‘TechOnTheNet’, 1, 4)
Result: ‘Tech’

SUBSTR(‘TechOnTheNet’, -3, 3)
Result: ‘Net’

SUBSTR(‘TechOnTheNet’, -6, 3)
Result: ‘The’

SUBSTR(‘TechOnTheNet’, -8, 2)
Result: ‘On’

Alisa

Alisa

DECLARE
v_error VARCHAR2(10);
BEGIN
SELECT ID INTO v_error
FROM employee;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.PUT_LINE(‘SQLERRM: ‘|| SUBSTR(SQLERRM, 100));
DBMS_OUTPUT.PUT_LINE(‘SQLCODE: ‘||SQLCODE);
END;
/

OUTPUT:
========================================
PL/SQL procedure successfully completed.

SQLERRM:
SQLCODE: -1422

Brando

Brando

Are these questions still valid for the 1z0-144 certification exam? cause i plan on taking it and would like to know please. WOuld really appreciate the help.

thanks

Sudeshna

Sudeshna

hi,

Are this dumps still valid ? if not then can someone please give me a valid link for recent dumps for FEB,2016

SK

SK

The answer will Probably be B
there is no data inserted in to the table, in the question.
So B will be right answer.

Mike

Mike

Tested it. It is B.

create table debug_output(msg varchar2(100));
/

create or replace procedure debugging (msg varchar2) as
pragma autonomous_transaction;
begin
insert into debug_output values(msg);
commit;
end;
/
show error

create or replace procedure delete_details (p_id number)
as
msg varchar2(100);
begin
delete from product where prod_id = p_id;
commit;
exception
when others then
msg:= substr(msg, 100);
debugging(msg);
end delete_details;

/

show error

execute delete_details(-100);

select * from debug_output

larissa

larissa

I don’t have any error message in your case

SK

SK

msg:= substr(sqlerrm, 100); is the tricky part.

sqlerrm is of length 24, and we are chosing 100 as starting postion which makes no sence as it will store null values in to debugging table.

So answer is A(tested and verified)