PL/SQL Flashcards
Which of the following is a valid PL/SQL block?
a) BEGIN dbms_output.put_line('Hello, World!');
b) DECLARE v_number NUMBER := 100;
c) BEGIN v_number := 100; END;
d) DECLARE v_number NUMBER := 100; BEGIN dbms_output.put_line(v_number); END;
d) DECLARE v_number NUMBER := 100; BEGIN dbms_output.put_line(v_number); END;
Which of the following is NOT a valid PL/SQL data type?
a) NUMBER
b) VARCHAR2
c) BOOLEAN
d) STRING
d) STRING
In PL/SQL, which keyword is used to handle exceptions?
- a) TRY
- b) CATCH
- c) EXCEPTION
- d) ERROR
- c) EXCEPTION
What will the following PL/SQL block output?
DECLARE
v_number NUMBER := 10;
BEGIN
v_number := v_number * 2;
dbms_output.put_line(v_number);
END;
a) 10
b) 20
c) 30
d) 40
b) 20
Which of the following is used to declare a cursor in PL/SQL?
- a)
OPEN cursor_name
- b)
DECLARE cursor_name
- c)
CURSOR cursor_name IS
- d)
FETCH cursor_name
- c)
CURSOR cursor_name IS