SA2 DBS - Sheet1 Flashcards
In anonymous block, DECLARE states “this is the start of a block”. In Procedure, ____________ states “this is the start of a subprogram”.
CREATE PROCEDURE
Which keyword is omitted in the declaration section of the procedure? _____
DECLARE
Subprograms are named PL/SQL blocks that are compiled and stored in the _______.
DATABASE
The IN parameters can only be read within the procedure and cannot be modified.
True
The positional parameter passing uses the associate operator.
False
The symbol»_space; is used for association operator?
False
The code below is a correct example of passing parameters by combination notation.
add_dept (p_loc=>1400, ‘EDUCATION’ );
False
The Positional parameter passing is the common method of passing parameters.
True
The type of parameter that is declared in procedure heading is called ________.
FORMAL
Which can be used to assign a default value to IN parameters?
All the options
The ____ parameters can be literal values, variables, or expressions that are sent to the parameter list of a called subprogram.
ACTUAL
Which parameter mode can be assigned a default value?
IN
OUT
IN OUT
IN
How many value is returned by a function?_____
1
A stored function must return exactly ____ value.
one
The functions used in SQL statements cannot use ____ or IN OUT modes.
IN
What is missing in the code below?
create or replace function sample
return number
is
begin
return 5+5;
end;
Group of answer choices
Formal parameter
Nothing is missing
Expression evaluation
Variable
Nothing is missing
Which of the statement below is valid? Assuming that get_sal procedure exists with one OUT parameter.
Group of answer choices
x:=100; DBMS_OUTPUT.PUT_LINE(get_sal(x));
All the options
x:= 200; DBMS_OUTPUT.PUT_LINE(get_sal(100+x));
PUT_LINE(get_sal(100));
x:=100; DBMS_OUTPUT.PUT_LINE(get_sal(x));
The purpose of the OR REPLACE clause is to ______ an existing procedure.
OVERWRITE
The _____ are named PL/SQL blocks that are compiled and stored in the database.
SUBPROGRAMS
The DECLARE keyword is not used in a subprogram.
Group of answer choices
True
False
True
In Procedure, all parameter modes must be specified.
Group of answer choices
True
False
False
The formal parameters can be literal values, variables, or expressions that are sent to the parameter list of a called subprogram.
Group of answer choices
True
False
The Named parameter passing is the common method of passing parameters.
Group of answer choices
True
False
False
The DEFAULT keyword is used to assign a default value for formal parameters.
Group of answer choices
True
False
What is the symbol used for association operator?
Group of answer choices
=
> >
=>
> =
=>
Assuming add_dept procedure has two parameters: p_name and p_id, what is the error in the given procedure call?
add_dept (‘ADVERTISING’, p_loc => 1400);
Group of answer choices
No error
The value of the positional parameter
The named parameter
Positional parameter must come before named parameter
The named parameter
If Combination notation is used, the _______ parameters must come first.
Group of answer choices
POSITIONAL
NAMED
POSITIONAL
What keyword is missing in the given function construct?
CREATE [OR REPLACE] function_name
[(parameter1 [mode1] datatype1, …)]
RETURN datatype IS|AS
[local_variable_declarations; …]
BEGIN
actions;
RETURN expression;
END [function_name];
FUNCTION
Functions return only a single value, and the value is returned through a ______ statement.
RETURN
A function must have a _______ clause in the header and at least one RETURN statement in the executable section.
Group of answer choices
PARAMETER
DECLARATION
RETURN
EXIT
RETURN
What follows the RETURN keyword at the function header?
Group of answer choices
IS
PARAMETER
VARIABLE
DATA TYPE
DATA TYPE
The _______ is added to CREATE PROCEDURE clause to overwrite an existing procedure.
OR REPLACE
Subprograms become the building blocks of packages and triggers.
Group of answer choices
True
False
True
If Combination notation is used, the positional parameters must come first before the named parameters.
Group of answer choices
True
False
True
To invoke a procedure from another procedure, use a direct call inside an executable section of the block.
Group of answer choices
True
False
t