Sie sind auf Seite 1von 5

Test: Quiz: Writing PL/SQL Executable Statements 1.

When PL/SQL converts data automatically from one data type to another, it is called _______ conversion. Mark for Review (1) Points Explicit Implicit (*) TO_CHAR

Correct 2. Which of the following data type conversions can be done implicitly? (C hoose two.) Mark for Review (1) Points (Choose all correct answers) DATE to NUMBER NUMBER to VARCHAR2 (*) NUMBER to PLS_INTEGER (*)

Incorrect. Refer to Section 2 Lesson 5. 3. Examine the following block. What should be coded at Line A? DECLARE v_char VARCHAR2(8) := '24/09/07'; v_date DATE; BEGIN v_date := ....... Line A END; Mark for Review (1) Points v_date := FROM_CHAR(v_char,'dd/mm/yy'); v_date := TO_DATE(v_char,'dd/mm/yy'); (*) v_date := v_char;

Incorrect. Refer to Section 2 Lesson 5. 4. Explicit conversions can be slower than implicit conversions. True or F alse? Mark for Review (1) Points True False (*)

Incorrect. Refer to Section 2 Lesson 5. 5. PL/SQL statements must be written on a single line. (1) Points True False (*) Mark for Review

Incorrect. Refer to Section 2 Lesson 5. 6. The LENGTH and ROUND functions can be used in PL/SQL statements. True o r False? Mark for Review (1) Points True (*) False

Correct 7. What will happen when the following code is executed? DECLARE v_new_date DATE; BEGIN v_new_date := 'Today'; DBMS_OUTPUT.PUT_LINE(v_new_date); END; Mark for Review (1) Points The block will execute and display today's date. The block will execute and display the word "Today".

The block will fail because the character value "Today" cannot be implic itly converted to a date. (*)

Correct 8. The DECODE and MAX functions can be used in PL/SQL statements. True or False? Mark for Review (1) Points True False (*)

Incorrect. Refer to Section 2 Lesson 5. 9. Using implicit conversions is good programming practice. Review (1) Points True False (*) Mark for

Correct 10. PL/SQL can implicitly convert a CHAR to a NUMBER, provided the CHAR con tains a numeric value, for example '123'. True or False? Mark for Review (1) Points True (*) False

Incorrect. Refer to Section 2 Lesson 5. 11. (1) Points Which of the following is correct? Mark for Review

v_family_name = SMITH; V_FAMILY_NAME = SMITH;

v_family_name := SMITH; v_family_name := 'SMITH'; (*)

Correct 12. Which of the following statements about implicit conversions is NOT tru e? Mark for Review (1) Points Code containing implicit conversions typically runs faster than code con taining explicit conversions. (*) Code containing implicit conversions may not work in the future if Oracl e changes the conversion rules. Code containing implicit conversions is harder to read and understand.

Incorrect. Refer to Section 2 Lesson 5. 13. The TO_CHAR function is used for explicit data type conversions. True o r False? Mark for Review (1) Points True (*) False

Incorrect. Refer to Section 2 Lesson 5. 14. Which explicit function is used to convert a character into a number? Mark for Review (1) Points TO_DATE TO_NUMBER (*) TO_CHAR

Correct

15. Examine the following code: DECLARE x VARCHAR2(20); BEGIN x:= 5 + 4 * 5 ; DBMS_OUTPUT.PUT_LINE(x); END; What value of x will be displayed? Mark for Review (1) Points 45 29 25 (*) 14

Correct ose three.) (1) Points 16. Which of the following are valid PL/SQL operators? (Cho Mark for Review (Choose all correct answers) Concatenation (*) Exception Exponential (*) Arithmetic (*)

Incorrect. Refer to Section 2 Lesson 5.

Das könnte Ihnen auch gefallen