DB2 Realtime (Scenario based) Interview Questions (41 - 47)

41. What is the maximum size of a CHAR data type in DB2?

CHAR can hold up to 254 characters in DB2. For longer text, use VARCHAR or CLOB.

42. What is the maximum size of a VARCHAR data type in DB2?

VARCHAR can store up to 32,672 characters, depending on the DB2 version and page size.

43. What does a positive SQL code indicates?

Positive SQLCODE means the statement ran successfully, but there’s a warning or special condition to handle.

44. When you will face SQLCODE -803?

SQLCODE -803 occurs when there is a duplicate key violation during an INSERT or UPDATE operation. It indicates a duplicate key error — the value violates a unique index or primary key constraint.

45. When you will face SQLCODE -818?

SQLCODE -818 indicates a timestamp mismatch between the application program and the DBRM, usually resolved by recompiling and rebinding.

46. When you will face SQLCODE -911?

SQLCODE -911 indicates a deadlock or timeout, and the transaction was rolled back automatically by DB2.

47. When you will face SQLCODE -922?

SQLCODE -922 indicates a permission or authorization error in DB2. The user or process does not have the required authority to perform the requested DB2 operation.