1. How can you migrate from a LONG to a LOB data type for a column?
2. Database triggers are designed:
3. Which cursor attribute returns the number of rows fetched from the active set in the case of an explicit cursor?
4. SQL%ISOPEN always evaluates to false in case of:
5. The process of Breaking Sql sentence into words and then checking them for syntax and object privileges is called:
6. Consider the following code: declare v_id number(3):=50; V_message(30):='Product 10012'; begin declare v_id number(3):=40; V_message(30):='welcome to world'; v_locn:='Europe; begin v_id:=v_id+20; end; end; Determine the value of V_ID variable in the outer block.
7. Which table should be queried to determine when a procedure was last compiled?
8. Examine the code given below: CREATE OR REPLACE PACKAGE comm_package IS g_comm NUMBER := 10; PROCEDURE reset_comm(g_comm IN NUMBER); END comm_package; User Jones executes the following code at 9:01am: EXECUTE comm_package.g_comm := 15 User Smith executes the following code at 9:05am: EXECUTE comm_paclage.g_comm := 20 Which of the following statements is correct?
9. Examine the package given below: CREATE OR REPLACE PACKAGE discounts IS g_id NUMBER := 7829; discount_rate NUMBER := 0.00; PROCEDURE display_price (p_price NUMBER); END discounts; / CREATE OR REPLACE PACKAGE BODY discounts IS PROCEDURE display_price (p_price NUMBER) IS BEGIN DBMS_OUTPUT.PUT_LINE( .Discounted .|| TO_CHAR(p_price*NVL(discount_rate, 1))); END display_price; BEGIN discount_rate :=0.10; END discounts; / Which of the following statements is correct?
10. When the procedure or function is invoked, Oracle engine loads the compiled procedure or function in the memory area called:
11. Which command is used to disable all the triggers on an EMP table?
12. Which statements are correct with regard to packages?
13. CREATE OR REPLACE PACKAGE manage_emp IS tax_rate CONSTANT NUMBER(5,2) := .28; v_id NUMBER; PROCEDURE insert_emp (p_deptno NUMBER, p_sal NUMBER); PROCEDURE delete_emp; PROCEDURE update_emp; FUNCTION cal_tax (p_sal NUMBER) RETURN NUMBER; END manage_emp; / CREATE OR REPLACE PACKAGE BODY manage_emp IS PROCEDURE update_sal (p_raise_amt NUMBER) IS BEGIN UPDATE emp SET sal = (sal * p_raise_emt) + sal WHERE empno = v_id; END; PROCEDURE insert_emp (p_deptno NUMBER, p_sal NUMBER) IS BEGIN INSERT INTO emp(empno, deptno, sal) VALUES (v_id, p_depntno, p_sal); END insert_emp; PROCEDURE delete_emp IS BEGIN DELETE FROM emp WHERE empno = v_id; END delete_emp; PROCEDURE update_emp IS v_sal NUMBER(10,2); v_raise NUMBER(10, 2); BEGIN SELECT sal INTO v_sal FROM emp WHERE empno = v_id; IF v_sal < 500 THEN v_raise := .05; ELSIP v_sal < 1000 THEN v_raise := .07; ELSE v_raise := .04; END IF; update_sal(v_raise); END update_emp; FUNCTION cal_tax (p_sal NUMBER)RETURN NUMBER IS BEGIN RETURN p_sal * tax_rate; END cal_tax; END manage_emp; / What is the name of the private procedure in this package?
14. Examine the code given below: CREATE OR REPLACE TRIGGER update_emp AFTER UPDATE ON emp BEGIN INSERT INTO audit_table (who, dated) VALUES (USER, SYSDATE); END; / You issue an UPDATE command in the EMP table, which results in changing 10 rows. How many rows are inserted in the AUDIT_TABLE ?
15. Which statement is correct?
16. Examine the code given below: Declare cursor emps is select Empno,ename,sal,deptno,job from emp; begin for rec in emps loop open emps; dbms_output.put_line(rec.empno||rec.ename||rec.sal||rec.deptno||rec.job); end loop; end; / What is wrong in above declaration?
17. Which program declarations are correct for a stored program unit?
18. Which procedure is called after a row has been fetched to transfer the value from the select list of the cursor to a local variable?
19. Which statements is correct with regard to stored procedures?
20. __________ is present in Oralce9i only.
21. Examine the code given below: CREATE OR REPLACE FUNCTION gen_email (first_name VARCHAR2, last_name VARCHAR2, id NUMBER) RETURN VARCHAR2 IS email_name VARCHAR2(19); BEGIN email_name := SUBSTR(first_name, 1, 1) || SUBSTR(last_name, 1, 7) ||[email protected] .; UPDATE employees SET email = email_name WHERE employee_id = id; RETURN email_name; END; Which of the following statements removes the function?
22. Which cursor allows passing values dynamically to a cursor?
23. Examine the Block given below: declare v_no number:=2; v_msg varchar2(20):='Goodbye'; begin case When v_no=1 then dbms_output.put_line('One!'); dbms_output.put_line('Another One!'); When v_no>1 then dbms_output.put_line('>1!'); dbms_output.put_line('Still>1!'); when v_msg='Goodbye' then dbms_output.put_line('Goodbye'); dbms_output.put_line('Adios'); else dbms_output.put_line('No Match'); end case; end; / What is the output of this block?
24. The OLD and NEW qualifiers can be used in Row level system trigger.
25. The Technique employed by the Oracle engine to protect table data when several people are accessing is called:
26. Which exception is raised when the data type or data size is invalid?
27. Which of the following Triggers is fired each time a row in the table is affected by the triggering statement?
28. Which type of argument passes a value from a procedure to the calling environment?
29. You need to create a trigger on the EMP table, which monitors every row that is changed and places this information in the AUDIT_TABLE. What type of trigger would you create?
30. Examine the code given below: CREATE OR REPLACE TRIGGER secure_emp BEFORE LOGON ON employees BEGIN IF (TO_CHAR(SYSDATE, 'DY') IN (SAT', 'SUN')) OR (TO_CHAR(SYSDATE, 'HH24:MI') NOT BETWEEN '08:00' AND '18:00') THEN RAISE_APPLICATION_ERROR (-20500, 'You may insert into the EMPLOYEES table only during business hours.'); END IF; END; / What type of trigger is this?
31. Which part of a database trigger determines the number of times a trigger body executes?
32. Which lock is used in Pl/Sql if the where clause evaluates to a set of data?
33. Examine the following code: CREATE OR REPLACE PROCEDURE add_dept ( p_name dept.dname%TYPE DEFAULT 'unknown', p_loc dept.locE%TYPE DEFAULT 1700) IS BEGIN INSERT INTO dept VALUES (dept_seq.NEXTVAL,p_name, p_loc); END add_dept; / You created the add_dept procedure above. Now you want to invoke the procedure in SQL *Plus. Which of the following are the valid invocations?
34. You need to drop a table from within a stored procedure. How would you do this?
35. A function CALTAX is given below: CREATE OR REPLACE FUNCTION caltax (sal NUMBER) RETURN NUMBER IS BEGIN RETURN (sal * 0.05); END CALTAX; Which of the following statements is correct in case you want to run this function from the SQL *Plus prompt?
36. Which one is not a legal declaration?
37. Which command is used to disable all the triggers on the EMPLOYEES table?
38. Examine the following function: CREATE OR REPLACE FUNCTION PLAYER_AVG (V_ID in PLAYER.PLAYER_ID%TYPE) RETURN NUMBER IS V_AVG NUMBER; BEGIN SELECT HITS INTO V_AVG FROM PLAYER WHERE PLAYER_ID = V_ID; RETURN (V_AVG); END; Which of the following statements will successfully invoke this function in SQL *Plus?
39. In Explicit lock, two database operations wait for each other to release a lock.
40. An internal LOB is _____.
41. A CALL statement inside the trigger body enables you to call:
42. All the packages can be recompiled by using an Oracle utility called:
43. Which two programming constructs can be grouped within a package?
44. The oracle server implicitly opens a cursor to process:
ADO.NET
Data Virtualization
Relational Database Management System RDBMS
Database
CMDB
Log Shipping
Related MCQ's