Which of the following DB2 data types does NOT have a fixed length?

  1. INT

  2. XML

  3. CHAR

  4. DOUBLE


Correct Option: B

AI Explanation

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

Option A) INT - This option is incorrect because INT is a fixed-length data type in DB2. It occupies a specific number of bytes, such as 4 bytes for a 32-bit integer.

Option B) XML - This option is correct because XML is a variable-length data type in DB2. The length of an XML value can vary depending on the specific XML document being stored.

Option C) CHAR - This option is incorrect because CHAR is a fixed-length character data type in DB2. It requires a specified length and pads any unused space with blanks.

Option D) DOUBLE - This option is incorrect because DOUBLE is a fixed-length floating-point data type in DB2. It occupies a specific number of bytes, such as 8 bytes for a 64-bit double precision floating-point number.

The correct answer is B) XML. This option is correct because XML is a variable-length data type in DB2, meaning its length can vary depending on the specific XML document being stored.

Find more quizzes: