Tag: technology

Questions Related to technology

Examine this procedure: CREATE OR REPLACE PROCEDURE ADD_PLAYER (V_ID IN NUMBER, V_LAST_NAME VARCHER2(30)) IS BEGIN INSERT INTO PLAYER(ID, LAST_NAME) VALUES(V_ID, V_LAST_NAME); COMMIT; END; Why does this command fail when executed?

  1. a) When declaring arguments length is not allowed.

  2. b) When declaring arguments each argument must have a mode specified.

  3. c) When declaring arguments each argument must have a length specified.

  4. d) When declaring a VARCHAR2 argument it must be specified.


Correct Option: A

AI Explanation

To answer this question, let's examine each option to understand why it is correct or incorrect:

Option A) When declaring arguments length is not allowed - This option is incorrect because the length is allowed when declaring arguments in a procedure.

Option B) When declaring arguments each argument must have a mode specified - This option is incorrect because it is a valid requirement to specify the mode (IN, OUT, or IN OUT) for each argument when declaring a procedure. However, the given procedure does not specify the mode for the arguments, but this is not the reason why the command fails.

Option C) When declaring arguments each argument must have a length specified - This option is incorrect because it is not necessary to specify the length for every argument when declaring a procedure. The length is only required for certain data types, such as VARCHAR2 or RAW.

Option D) When declaring a VARCHAR2 argument it must be specified - This option is incorrect because it is not necessary to specify the VARCHAR2 data type when declaring a procedure. The data type can be specified as VARCHAR2 or VARCHAR, and both are valid.

The correct answer is A) When declaring arguments length is not allowed. This option is correct because in the given procedure, the V_LAST_NAME parameter is missing the length specification for the VARCHAR2 data type. The correct declaration should be V_LAST_NAME VARCHAR2(30) to specify the length.

Therefore, the command fails because the declaration of the V_LAST_NAME parameter is missing the length specification.

  1. a) In the package body.

  2. b) In the data base triggers.

  3. c) In the package specification.

  4. d) In the procedures declare section using the exact name in each.


Correct Option: A
  1. a) The COMMIT and ROLLBACK commands are allowed in the packaged function.

  2. b) You can not use packaged functions in a query statement.

  3. c) The packaged function cannot execute an INSERT, UPDATE, or DELETE statement against the table that is being queried.

  4. d) The packaged function can execute and INSERT, UPDATE, or DELETE statement against the table that is being queried if it is used in a subquery.

  5. e) The packaged function can execute an INSERT, UPDATEM or DELETE statement against the table that is being queried if the pragma RESTRICT REFERENCE is used.


Correct Option: C
  1. a) GRANT SELECT ON ADD_PLAYER TO PUBLIC;

  2. b) GRANT EXECUTE ON ADD_PLAYER TO PUBLIC;

  3. c) GRANT INSERT ON PLAYER TO PUBLIC;

  4. d) GRANT EXECUTE, INSERT ON ADD_PLAYER TO PUBLIC;

  5. e) REVOKE INSERT ON PLAYER FROM PUBLIC;


Correct Option: B,E

Examine this procedure: CREATE OR REPLACE PROCEDURE ADD_PLAYER (V_ID IN NUMBER, V_LAST_NAME VARCHER2(30)) IS BEGIN INSERT INTO PLAYER(ID, LAST_NAME) VALUES(V_ID, V_LAST_NAME); COMMIT; END; Why does this command fail when executed?

  1. a) When declaring arguments length is not allowed.

  2. b) When declaring arguments each argument must have a mode specified.

  3. c) When declaring arguments each argument must have a length specified.

  4. d) When declaring a VARCHAR2 argument it must be specified.


Correct Option: A

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) When declaring arguments length is not allowed - This option is incorrect because in the given procedure, the length is specified for the VARCHAR2 argument V_LAST_NAME.

Option B) When declaring arguments each argument must have a mode specified - This option is incorrect because in the given procedure, the mode for each argument is not specified. However, the absence of a mode specification does not cause the command to fail.

Option C) When declaring arguments each argument must have a length specified - This option is incorrect because in the given procedure, the length is specified for the VARCHAR2 argument V_LAST_NAME.

Option D) When declaring a VARCHAR2 argument it must be specified - This option is incorrect because in the given procedure, the VARCHAR2 argument V_LAST_NAME is specified.

The correct answer is A) When declaring arguments length is not allowed. This option is correct because in the given procedure, the length is specified for the VARCHAR2 argument V_LAST_NAME, which is not allowed. The correct syntax for declaring a VARCHAR2 argument should be VARCHAR2(30).

Therefore, the command fails when executed due to the incorrect length specification for the VARCHAR2 argument.

  1. Tells you who's logged in, and what they're doing

  2. Tells you when the user last logged

  3. Lets you change your password

  4. None of the above


Correct Option: A

How do you handle an Exception?

  1. a) Trap it with a Handler

  2. b) Propagate it to the Calling Environment

  3. c) a & then b

  4. d) b & then a


Correct Option: C