Monday, April 28, 2008

PLSQL INTERVIEW QUESTIONS

16) Which procedure can be used to create a customizederror message?1. RAISE_ERROR2. SQLERRM3. RAISE_APPLICATION_ERROR 4. RAISE_SERVER_ERROR 17) The CHECK_THEATER trigger of the THEATER table has been disabled. Which command can you issue to enable this trigger? 1. ALTER TRIGGER check_theater ENABLE;2. ENABLE TRIGGER check_theater; 3. ALTER TABLE check_theater ENABLE check_theater; 4. ENABLE check_theater; 18) Examine this database trigger CREATE OR REPLACE TRIGGER prevent_gross_modification{additional trigger information} BEGIN IF TO_CHAR(sysdate, DY) = MON THEN RAISE_APPLICATION_ERROR(-20000, Gross receipts cannot be deleted on Monday); END IF; END; This trigger must fire before each DELETE of theGROSS_RECEIPT table. It should fire only once for the ent. What additional information must you add? 1. BEFORE DELETE ON gross_receipt 2. AFTER DELETE ON gross_receipt 3. BEFORE (gross_receipt DELETE) 4. FOR EACH ROW DELETED FROM gross_receipt 19) Examine this function: CREATE OR REPLACE FUNCTION set_budget (v_studio_id IN NUMBER, v_new_budget IN NUMBER) IS BEGIN UPDATE studio SET yearly_budget = v_new_budgetWHERE id = v_studio_id; IF SQL%FOUND THENRETURN TRUEl;ELSERETURN FALSE;END IF; COMMIT;END;

Which code must be added to successfully compile thisfunction?

1. Add RETURN right before the IS keyword.

2. Add RETURN number right before the IS keyword.

3. Add RETURN boolean right after the IS keyword.

4. Add RETURN boolean right before the IS keyword.

20) Under which circumstance must you recompile the package body after recompiling the packagespecification?

1. Altering the argument list of one of the packageconstructs

2. Any change made to one of the package constructs

3. Any SQL statement change made to one of thepackage constructs

4. Removing a local variable from the DECLARE sectionof one of the package constructs

0 comments: