C2090-733 Free Dumps Study Materials
Question 16: A table named ACTIVITY.LOG was created by executing the following
statement:CREATE TABLE
activity.log (event VARCHAR(128), date DATE) Then, a stored procedure named
ACTIVITY.LOGEVENT
was created by executing the following statement: CREATE PROCEDURE
activity.logEvent(IN stmtType
CHAR(1)) LANGUAGE SQLMainBody: BEGIN DECLARE sqlerrm VARCHAR(256)
DEFAULT '';
DECLARE ErrorIndicator CHAR(1) DEFAULT 'N';
SQLStmt: BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
BEGIN
SET ErrorIndicator = 'Y';
END;
IF stmtType = 'I' THEN
INSERT INTO activity.log VALUES('Insert Operation Performed.', CURRENT_DATE);
ELSEIF stmtType = 'U' THEN
INSERT INTO activity.log VALUES('Update Operation Performed.', CURRENT_DATE);
ELSEIF stmtType = 'D' THEN I
NSERT INTO activity.log VALUES('Delete Operation Performed.', CURRENT_DATE);
ELSE
SET ErrorIndicator = 'Y';
END IF;
END SQLStmt;
IF ErrorIndicator = 'Y' THEN
SIGNAL SQLSTATE '70000' SET message_text = 'Could not update activity log.';
END IF;
END MainBody
User USER1 has the authority to access/manipulate data in the ACTIVITY.LOG table as well
as to invoke
the
procedure ACTIVITY.LOGEVENT. If user USER1 executes the following commands:
CONNECT TO sample USER user1 USING ibmdb2;
DELETE FROM activity.log;
CALL activity.logEvent('i'); What will be the results?
A. The string "Insert Operation Performed." and the system date will be written to the
ACTIVITY.LOG
table.
B. The string "Update Operation Performed." and the system date will be written to the
ACTIVITY.LOG
table.
C. The string "Delete Operation Performed." and the system date will be written to the
ACTIVITY.LOG
table.
D. The error message 'SQL0438N Application raised error with diagnostic text: "Could not
update activity
log.".SQLSTATE=70000' will be generated.
Correct Answer: D