oracle section 8 quiz answer


1. Procedure SOMEPROC has five parameters named A, B, C, D, E in that order. The procedure was called as follows:

SOMEPROC(10,20,30,D=>50,E=>60);


How was parameter B referenced?


Mark for Review


(1) Points

Defaulted

Positional (*)

Named

A combination of positionally and named

A combination of named and defaulted

Correct

2. Suppose you set up a parameter with an explicit OUT mode. What is true about that parameter?

Mark for Review


(1) Points

It acts like a constant (its value cannot be changed inside the subprogram).

It cannot have a DEFAULT value. (*)

It inherits its type from the matching IN parameter.

It must be the same type as the matching IN parameter.

It must have a DEFAULT value.

Correct

3. Procedure SOMEPROC has five parameters named A, B, C, D, E in that order. The procedure was called as follows:

SOMEPROC(10,20,30,D=>50,E=>60);


How was parameter D referenced?


Mark for Review


(1) Points

Defaulted

A combination of named and defaulted

Positionally

A combination of positionally and named

Named (*)

Correct

4. When creating a procedure, where in the code must the parameters be listed?

Mark for Review


(1) Points

After the keyword IS or AS

Before the procedure name

After the procedure name (*)

After the keyword PROCEDURE

Correct

5. A procedure is invoked by this command:

myproc('Smith',salary=>5000);


What is the method of passing parameters used here?


Mark for Review


(1) Points

Named

None of these.

Positional

A combination of positional and named (*)

6. You want to create a procedure which accepts a single parameter. The parameter is a number with a maximum value of 9999.99. Which of the following is a valid declaration for this parameter?

Mark for Review


(1) Points

(v_num NUMBER(4,2))

(v_num)

(v_num NUMBER) (*)

(v_num NUMBER(6,2))

Correct

7. Which of the following best describes the difference between a parameter and an argument?

Mark for Review


(1) Points

A parameter is a variable that accepts a value that is passed to it, while an argument is the value that is passed. (*)

There is no difference; parameters and arguments are the same thing.

They are both names of variables. A parameter is passed into the procedure, while an argument is passed out of the procedure.

A parameter is the name of a variable, while an argument is the datatype of that variable.

Correct

8. You want to create a procedure named SOMEPROC which accepts a single parameter named SOMEPARM. The parameter can be up to 100 characters long. Which of the following is correct syntax to do this?

Mark for Review


(1) Points

CREATE PROCEDURE someproc

    (someparm 100)

IS

BEGIN ...


CREATE PROCEDURE someproc

    (someparm varchar2(100) )

IS

BEGIN...


CREATE PROCEDURE someproc

    (someparm varchar2)

IS

BEGIN ...

(*)

CREATE PROCEDURE someproc

    someparm varchar2(100);

IS

    BEGIN...

CREATE PROCEDURE someproc

IS

    (someparm VARCHAR2;)

BEGIN...


Incorrect. Refer to Section 8 Lesson 2.

9. Which of the following statements about actual parameters is NOT true?

Mark for Review


(1) Points

The datatypes of an actual parameter and its formal parameter must be compatible.

An actual parameter can have a Boolean datatype.

An actual parameter must be the name of a variable. (*)

An actual parameter is declared in the calling environment, not in the called procedure.

An actual parameter can have a TIMESTAMP datatype.

Correct

10. Which of the following can NOT be uTest: PL/SQL Section 8 Quiz


11. A PL/SQL procedure named MY_PROC1 has been successfully created in the database. The procedure has no parameters. Which of the following will successfully invoke the procedure in Application Express? (Choose two.)

CREATE OR REPLACE PROCEDURE my_proc2 IS

BEGIN

    my_proc1;

END my_proc2;

(*)

SELECT my_proc1 FROM DUAL;


DECLARE

    v_var1 NUMBER := 20;

BEGIN

    my_proc1(v_var1);

END;


EXECUTE my_proc1;


BEGIN

    my_proc1;

END;

(*)

Incorrect. Refer to Section 8 Lesson 1.

12. Which of the following are characteristics of PL/SQL subprograms but not of anonymous PL/SQL blocks? (Choose three.)

Mark for Review


(1) Points

Are compiled every time they are executed


Can take parameters

(*)

Are stored in the database

(*)

Are named

(*)

Can begin with the keyword DECLARE


Correct

13. A PL/SQL stored procedure can accept one or more input parameters and can return one or more output values to the calling environment. True or False?

Mark for Review


(1) Points

TRUE (*)

FALSE

Correct

14. A stored PL/SQL procedure can be invoked from which of the following?

A PL/SQL anonymous block

Another PL/SQL procedure

A calling application

Mark for Review


(1) Points

A, B and C (*)

A and B

B and C

A only

A and C

Incorrect. Refer to Section 8 Lesson 1.

15. What is another name for a nested subprogram?

Mark for Review


(1) Points

Local subprogram (*)

Limited subprogram

Hosted subprogram

(1) Points

The name of another procedure (*)

A non-SQL datatype such as BOOLEAN

A PLSQL record defined using %ROWTYPE

A large object datatype such as CLOB



Comments

Popular Posts