Using the Ignore character length semantics option

Last modified: January 24, 2025

dbForge Schema Compare detects and displays differences in object definitions and their corresponding SQL scripts.

If column length differences are not critical for schema synchronization or if you work with large schemas where character length inconsistencies are common but do not impact functionality, you can enable the Ignore character length semantics option during schema comparison.

This option ignores differences in the defined character length of string-based columns, such as CHAR and VARCHAR2, during schema comparison.

If character length is the only difference between database objects, dbForge Schema Compare considers them identical, and no differences appear in Text Compare. In addition, objects in the Identical section will not be included in the deployment script. However, if there are other differences in object definitions or SQL scripts beyond character length, the tool detects and displays all changes, and Text Compare highlights all these discrepancies.

Note

Schema Compare compares the structure of SQL database objects, such as tables, views, or procedures, between two schemas to identify differences and synchronize them. Text Compare, on the other hand, focuses on comparing the text of SQL scripts, such as DDL, DML, etc., identifying differences in code, such as spaces, comments, and line order, without considering the database context.

Workflow

Prerequisites

To illustrate how the option works, we have created the following tables:

-- source and target tables with the only character length difference
CREATE TABLE T_TABLE (
  PK NUMBER,
  TXT_1 VARCHAR2(255 BYTE),
  TXT_2 VARCHAR2(255 CHAR))
LOGGING;

CREATE TABLE T_TABLE (
  PK NUMBER,
  TXT_1 VARCHAR2(255 CHAR),
  TXT_2 VARCHAR2(255 BYTE))
LOGGING;

-- source and target tables with differences in object definitions or SQL scripts
CREATE TABLE HR_DEV.T_TABLE2(
  pk NUMBER PRIMARY KEY,
  txt_1 VARCHAR2(255 BYTE),
  txt_2 VARCHAR2(255 CHAR)
  );

CREATE TABLE HR_DEV.T_TABLE2(
  pk NUMBER,
  txt_1 VARCHAR2(255 CHAR),
  txt_2 VARCHAR2(255 BYTE)
  );

Running schema comparison with the enabled Ignore character length semantics option

To run schema comparison:

1. On the toolbar, select New Schema Comparison to open the New Schema Comparison wizard.

2. On the Source and Target page of the wizard, select the source and target Database types, choose the connections, and select the schemas. To proceed, select Next.

Source and Target page of New Schema Comparison: specify source and target details

3. On the Options page, select the Ignore character length semantics option and then select Compare to run schema comparison.

Options page of New Schema Comparison: specify source and target details

This will open the Schema Comparison document, which displays database objects selected for schema synchronization.

Example 1: The tool considers database objects equal

With the Ignore character length semantics option enabled, the T_TABLE tables appear in the Equal section of the Schema Comparison document. In this case, the tool considers the columns identical, ignoring the difference in VARCHAR length. Note that since there are no other differences apart from semantics, Text Compare does not highlight any discrepancies.

Example: The tool considers the database objects as equal

Example 2: The tool considers database objects different

Though the Ignore character length semantics option is enabled, the T_TABLE tables appear in the Different section of the Schema Comparison document because their DDLs differ. In this case, Text Compare highlights differences in DDLs and semantics.

Example: The tool considers the database objects as different