Running the AddColumns Tool
The AddColumns tool is run from a Windchill shell.
* 
Before running the AddColumns to add local attribute columns to a type, first run the AddColumns tool with the -r parameter to check for any warnings. Correct those warnings before proceeding to add local attribute columns to the type.
The usage of the AddColumns tool is as follows:
AddColumns [-a][-u][-r][-syncFromDB] type_name datatype=number {datatype=number} [directory] [-s][-f][-stringSize]
AddColumns -u [-s]
AddColumns -r type_name [directory]
AddColumns -syncFromDB
AddColumns [-a] type_name [datatype=number {datatype=number}] -stringSize
The square brackets ( [ ] )indicate parameters that are optional, while the curly brackets ( { } ) indicate parameters that can be specified more than once. To see the usage details for the AddColumns tool, execute the AddColumns command from a Windchill shell with no additional parameters.
The following table describes the input parameters and arguments that can be specified with the AddColumns tool:
Parameter
Description
-a
Adds additional columns only to the specified type class without upgrading the database schema. The type_name and datatype and number parameters must also be specified. Updates the introspection (.ser) and class files (.class) to include the new columns.
* 
The total number of ObjectReference and VersionReference columns on a type cannot exceed thirty-five (35).
-u
Upgrade the database schema and the local attribute column schema file. This parameter must be used after running the command with the -a parameter on multiple types, before starting or restarting the method server. Unless the -s parameter is specified at the same time as the -u parameter, the Upgrade Schema window of the Windchill Upgrade Tool is launched to display progress. The window disappears once the database schema upgrade completes.
Upgrading the database schema (running the AddColumns tool with the -u parameter) can take a long time. As a result, the -u parameter is typically run only after running the AddColumns tool with the -a parameter multiple times.
If you exceed the maximum number of ObjectReference and VersionReference columns on a type (35), or if the total number of columns on the type added exceeds the maximum allowed for your database, the database schema upgrade fails.
-r
Reports the column information for the specified type. For more information, see AddColumns Report and Addressing Warnings.
-syncFromDB
Updates the local attribute column schema file to match the database schema, and also updates the introspection (.ser) and class files (.class) to match the database schema for all types.
type_name
The fully qualified name of the modeled class to which to add the columns. This value is displayed in the Internal Name field for the type in the Type and Attribute Management utility.
datatype
The data type of column to add. The legal values are: String, Long, Double, Boolean, Timestamp, ObjectReference, VersionReference, and InlineBLOB.
number
The number of columns to add.
directory
The directory in which to store the generated type column Java files. This parameter is optional. Without this parameter, the generated Java files are stored in <Windchill>\temp\src.
-s
Run in silent mode, that is, the Upgrade Schema window of the Windchill Upgrade Tool is not launched. This parameter is valid only when specified with the -u or -syncFromDB parameters.
-f
Force columns to be added even if the total number of table columns will be greater than 255. Increasing the number of total columns above 255 can impact performance. You cannot add more columns than the maximum number allowed for your database.
-stringSize
Reconfigure the column size of String data type columns based on the value of the com.ptc.core.lwc.string.ColumnSizes property (valid range is 500-4000). For more info see, Setting a Larger Database Column Size for String Local Attributes.
* 
The AddColumns tool validates the source database and the target database for Multi-Byte character set (Only for Oracle). This tool performs the action of adding columns only if both have the same maxBytesPerChar factor, or the source database being a single-byte and the target database is a multi-byte. This action is not supported for a multi-byte source database and a single-byte target database.
Was this helpful?