databases Online Quiz - 143
Description: databases Online Quiz - 143 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: databases |
The maximum size for expressions, variables, and arguments passed to stored procedures.
create or replace function add_three_numbers (a number := 0, b number := 0, c number := 0) return number is Begin return a+b+c; End; / Which is not a valid procedure call in Oracle 10g
To be callable from SQL expressions, a user-defined function must: 1. Be a stored function 2. Accept only IN parameters 3. Accept only valid SQL data types, not PL/SQL specific types, as parameters 4. Return data types that are valid SQL data types, not PL/SQL specific types
In For Loop syntax to go in reverse order
Declare Cursor c is select * from emp; I emp%row_type; Begin open c; fetch c into I; loop Dbms_output_line(‘Emp name:’ || i.ename); fetch c into I; exit when c%notfound; End loop; End; What is the error in above PL/SQL Block
Which attribute is not correct for an explicit cursor?
What is the smallest PL/SQL Block?
What is true about the simple loop statement? 1. Loop block has entry criteria 2. Loop block checks for exit criteria 3. We need to put an entry criteria manually 4. We need to put an exit criteria manually. 5. Loop without any exit criteria will be indefinite loop.
Syntax for case structure?
Begin Dbms_output.put_line(‘Hello world’) End; What is the error in the above block?
DECLARE sal_limit NUMBER ( 4 ) := 0 ; my_ename emp.ename%TYPE ; my_sal emp.sal%TYPE ; CURSOR my_cursor IS SELECT ename , sal FROM emp WHERE sal > sal_limit ; BEGIN sal_limit := 1200 ; OPEN my_cursor; fetch my_cursor INTO my_ename , my_sal ; LOOP FETCH my_cursor INTO my_ename , my_sal ; EXIT WHEN my_cursor%NOTFOUND ; -- nothing returned INSERT INTO new_table VALUES ( my_ename , my_sal ) ; END LOOP ; COMMIT ; END ;
CREATE OR REPLACE FUNCTION dml_call_sql (p_sal NUMBER) RETURN NUMBER IS BEGIN INSERT INTO employees(employee_id, last_name, email, hire_date, job_id, salary) VALUES(1, 'employee 1', '[email protected]', SYSDATE, 'SA_MAN', 1000); RETURN (p_sal + 100); END; / Function created. UPDATE employees SET salary = dml_call_sql(2000) WHERE employee_id = 170; What is the error in the block
How many type of cursors are available?
For processing rows in a specific sequence,