Tag: technology

Questions Related to technology

  1. a) Only local or packaged sub programs can be overloaded.

  2. b) Overloading allows different functions with the same name that differ only in their return types.

  3. c) Overloading allows different subprograms with the same number, type and order of the parameter.

  4. d) Overloading allows different subprograms with the same name and same number or type of the parameters.

  5. e) Overloading allows different subprograms with the same name but different in either number or type or order of parameter.


Correct Option: A,E

What is the statement to create 2 files from 1 particular i/p file on specific conditions?

  1. OUTREC

  2. INREC

  3. OUTFIL

  4. None of the above


Correct Option: C
  1. a) Packages can be nested.

  2. b) You can pass parameters to packages.

  3. c) A package is loaded into memory each time it is invoked.

  4. d) The contents of packages can be shared by many applications.

  5. e) You can achieve information hiding by making package constructs private.


Correct Option: D,E
  1. a) The package itself cannot be called, parameterized, or nested.

  2. b) The format of a package is similar to that of a subprogram.

  3. c) The contents can be shared by many applications once written.

  4. d) None of the above.


Correct Option: D
  1. INCLUDE COND = (10,3,CH,EQ,C'YES') SORT FIELDS = (1,5,CH,A)

  2. SORT FIELDS = (1,5,CH,A) INCLUDE COND = (10,3,CH,EQ,C'YES')

  3. Order doesn't matter

  4. INCLUDE COND = (10,3,CH,EQ,C'YES') SORT FIELDS = COPY


Correct Option: A

When you use the DEFINE variable command, what datatype is the variable?

  1. VARCHAR2

  2. CHAR

  3. LONG

  4. NUMBER


Correct Option: B

Which two program declarations are correct for a stored program unit? (Choose two)

  1. a) CREATE OR REPLACE FUNCTION tax_amt (p_id NUMBER) RETURN NUMBER

  2. b) CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER) RETURN NUMBER

  3. c) CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER, p_amount OUT NUMBER)

  4. d) CREATE OR REPLACE FUNCTION tax_amt (p_id NUMBER) RETURN NUMBER(10,2)

  5. e) CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER, p_amount OUT NUMBER(10, 2))


Correct Option: A,C

AI Explanation

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

Option A) a) CREATE OR REPLACE FUNCTION tax_amt (p_id NUMBER) RETURN NUMBER - This option is correct because it declares a stored function named "tax_amt" that takes a parameter "p_id" of type NUMBER and returns a value of type NUMBER.

Option B) b) CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER) RETURN NUMBER - This option is incorrect because it declares a stored procedure, not a function. The keyword "RETURN NUMBER" is not applicable for a procedure declaration.

Option C) c) CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER, p_amount OUT NUMBER) - This option is correct because it declares a stored procedure named "tax_amt" that takes two parameters "p_id" and "p_amount". The "p_amount" parameter is an OUT parameter, which means it will be used to return a value.

Option D) d) CREATE OR REPLACE FUNCTION tax_amt (p_id NUMBER) RETURN NUMBER(10,2) - This option is incorrect because it declares a stored function with a return type of NUMBER(10,2), which is not valid syntax. The return type should be just NUMBER without any precision or scale specified.

Option E) e) CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER, p_amount OUT NUMBER(10, 2)) - This option is incorrect because it declares a stored procedure with an OUT parameter "p_amount" of type NUMBER(10, 2), which is not valid syntax. The parameter type should be just NUMBER without any precision or scale specified.

The correct answers are A) CREATE OR REPLACE FUNCTION tax_amt (p_id NUMBER) RETURN NUMBER and C) CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER, p_amount OUT NUMBER). These options correctly declare a stored function and a stored procedure, respectively.