ProjectWise Administrator Help

Setting Length Values for Character Data Types

When creating environment attributes, the type of data that can be stored in a database table column, and the length value for character data types, is dependent on the data type and the supporting database. To ensure consistent behavior across data types, ProjectWise uses length multipliers.

When the Use native data type option is off in the New Column Properties dialog, among the many different data types that can be selected, there are four which can be used to define character columns: CHAR, VARCHAR, WCHAR, and VARWCHAR. The CHAR and WCHAR data types are fixed length character data, while the VARCHAR and VARWCHAR data types are for variable length character data. The selection of any of these types requires a length to be specified. Depending on your datasource's supporting database, the type of character data and the length of the strings can have different meanings.

The table below shows the character and wide character data types defined by ProjectWise. VARCHAR and CHAR data types support unicode characters when the underlying database is Oracle, but not when the underlying database is SQL Server. The length specifier in most cases is in bytes, however depending on the value of the NLS_LENGTH_SEMANTICS parameter in Oracle, the length indicator can be in characters. The wide character data types, VARWCHAR and WCHAR, all support unicode characters and the length specifier in each case represents the number of characters.

Database

VARCHAR / CHAR

Length

VARWCHAR / WCHAR

Length

Oracle

unicode characters

# of bytes/chars

unicode characters

# of characters

SQL Server

non-unicode characters

# of bytes

unicode characters

# of characters

When the Use native data type option is on in the New Column Properties dialog, there are one or two native data types that can be used to define a column depending on the datasource's supporting database. The following table shows that each of the native character data types for Oracle support unicode characters. The length specifier in most cases represents the number of bytes, however depending on the value of the NLS_LENGTH_SEMANTICS parameter in Oracle, the length indicator can be in characters. SQL Server supports two data types that correspond to the character and wide character data types shown in the previous table.

Database

Native Types

Length

Oracle

VARCHAR2 / CHAR - unicode characters

number of bytes/chars

SQL Server

VARCHAR - non-unicode characters

number of bytes

 

NVARCHAR - unicode characters

number of characters