Thread: Examine the below procedure
05-25-12, 04:37 #1Registered User
- Join Date
- Feb 2012
Unanswered: Examine the below procedure
please examine the below stored procedure and write me the error and the issue in this
CREATE OR REPLACE PROCEDURE DELETE_PLAYER(V_ID IN NUMBER)
DELETE FROM PLAYER
WHERE ID = V_ID
WHEN STATS_EXITS_EXCEPTION THEN
DBMS_OUTPUT.PUT_LINE(Cannotdeletethisplayer, childrecordsexistin PLAYER_BAT_STAT table);
What prevents this procedure from being created successfully?
A. A comma has been left after the STATS_EXIST_EXCEPTION exception.
B. The STATS_EXIST_EXCEPTION has not been declared as a number.
C. The STATS_EXIST_EXCEPTION has not been declared as an exception.
D. Only predefined exceptions are allowed in the EXCEPTION section.
2. Under which two circumstances do you design database triggers? (Choose two)
A. To duplicate the functionality of other triggers.
B. To replicate built-in constraints in the Oracle server such as primary key and foreign key.
C. To guarantee that when a specific operation is performed, related actions are performed.
D. For centralized, global operations that should be fired for the triggering statement, regardless of which user or application issues the statement.
3. Local procedure A calls remote procedure B. Procedure B was compiled at 8 A.M. Procedure
A was modified and recompiled at 9 A.M. Remote procedure B was later modified and
recompiled at 11 A.M. The dependency mode is set to TI MESTAMP. What happens when
procedure A is invoked at 1 P.M?
A. There is no affect on procedure A and it runs successfully.
B. Procedure B is invalidated and recompiles when invoked.
C. Procedure A is invalidated and recompiles for the first time it is invoked.
D. Procedure A is invalidated and recompiles for the second time it is invoked.
4. What is a condition predicate in a DML trigger?
A. A conditional predicate allows you to specify a WHEN-LOGGING-ON condition in the trigger body.
B. A conditional predicate means you use the NEW and OLD qualifiers in the trigger body as a condition.
C. A conditional predicate allows you to combine several DML triggering events into one in the trigger body.
D. A conditional predicate allows you to specify a SHUTDOWN or STARTUP condition in the trigger body.
5. This statement fails when executed:
CREATE OR REPLACE TRIGGER CALC_TEAM_AVG
AFTER INSERT ON PLAYER
INSERT INTO PLAYER_BATSTAT (PLAYER_ID, SEASON_YEAR, AT_BATS, HI TS)
VALUES (:NEW.ID, 1997, 0, 0) ;
To which type must you convert the trigger to correct the error?
C. ORACLE FORM trigger
6. An internal LOB is _____.
A. A table.
B. A column that is a primary key.
C. Stored in the database.
D. A file stored outside of the database, with an internal pointer to it from a database column.
7. You need to disable all triggers on the EMPLOYEES table. Which command accomplishes this?
A. None of these commands; you cannot disable multiple triggers on a table in one command.
B. ALTER TRIGGERS ON TABLE employees DISABLE;
C. ALTER employees DISABLE ALL TRIGGERS;
D. ALTER TABLE employees DISABLE ALL TRIGGERS;
8. You have a row level BEFORE UPDATE trigger on the EMP table. This trigger contains a SELECT statement on the EMP table to ensure that the new salary value falls within the minimum and maximum salary for a given job title. What happens when you try to update a salary value in the EMP table?
A. The trigger fires successfully.
B. The trigger fails because it needs to be a row level AFTER UPDATE trigger.
C. The trigger fails because a SELECT statement on the table being updated is not allowed.
D. The trigger fails because you cannot use the minimum and maximum functions in a BEFORE UPDATE trigger.
9. You need to implement a virtual private database (vpd). In order to have the vpd functionality, a trigger is required to fire when every user initiates a session in the database. What type of trigger needs to be created?
A. DML trigger
B. System event trigger
C. INSTEAD OF trigger
D. Application trigger
10. Which two program declarations are correct for a stored program unit? (Choose two)
A. CREATE OR REPLACE FUNCTION tax_amt (p_id NUMBER) RETURN NUMBER
B. CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER) RETURN NUMBER
C. CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER, p_amount OUT NUMBER)
D. CREATE OR REPLACE FUNCTION tax_amt (p_id NUMBER) RETURN NUMBER(10,2)
E. CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER, p_amount OUT NUMBER(10, 2))
05-29-12, 08:48 #2Registered User
- Join Date
- Jun 2003
- West Palm Beach, FL
If you expect us to answer the homework questions for you, you are wrong, that would be cheeting.
Besides if you don't do the effort yourself, you will not learn anything.
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb