# Guide to use the script for SPR 1155075.

## Background

The script is used to set common names in Pro/Intralink to a user specified attribute value. The attribute could be any system defined or user-defined versioned and non-versioned attribute. Lifecycle attributes are also supported. The script is applicable to Intralink 3.3 and 3.4.

## Usage:

Execute the script with SQL*Plus in following format,

sqlplus system/manager@intralink @set_common_name_1155075.sql

attribute_name attribute_type default_value overwrite_existing

Where attribute_name is the name of the attribute kept in Intralink. For example, pi_desc, name, piv_desc...

attribute_type is the type of the attribute. It must be one of the following:

- 'v: Versioned User-Defined Attribute
- sv: Versioned System Attribute
- nv: Non-Versioned User-Defined Attribute
- snv: Non-Versioned System Attribute
- l: Lifecycle Attribute

default_value is used when the attribute value is null.

overwrite_existing can be either YES or NO. “YES” means to overwrite the existing non-empty Commonname Values, while “NO” means existing non-empty Commonnames will be kept.

## Notes

- If the specified attribute is a user-defined attribute and it has a default value, when the attribute is not explicitly defined on an object, the attribute’s default value will be used instead of the specified default value.
- All the command line arguments are required. If it is not specified, SQL*Plus will prompt the user for the value. For example, when the default_value is missed, SQL*Plus will ask the user to input it:

Enter value for 3:

- Value “1”, “2”, “3” and “4” in SQL*Plus correspond to attribute_name, attribute_type, default_value, overwrite_existing in the command line respectively.
- When the input attribute is a versioned attribute or a lifecycle attribute, the attribute value of the latest PIV on the main branch of a PI will be used to populate its common name.
- If the common name is already set (not null), the value will be kept unchanged.
- The specified attribute type must be a String type attribute.
- If the attribute value has more than 400 characters, it will be truncated to 400 characters to fit in the common name field.

## Examples:

- Following command sets all the common names to their corresponding PI names, and the default value is null:

sqlplus system/manager@intralink @set_common_name_1155075.sql \

name snv ‘’ YES

§ § Following command set all the empty common names to their main branches’ latest PIVs’ descriptions, and the default value is ----:

sqlplus system/manager@intralink @set_common_name_1155075.sql \

piv_desc sv ‘----’ NO

§ § Following command sets all the common names to their main branches’ latest PIVs’ attribute “Manufacturer”, and the default value is ----:

sqlplus system/manager@intralink @set_common_name_1155075.sql \

Manufacturer v ‘----’ YES

§ § Following command sets all the common names to its non-versioned attribute “Material”, and the default value is ----:

sqlplus system/manager@intralink @set_common_name_1155075.sql \

Material nv ‘----’ YES

§ § Following command sets all the empty common names to its lifecycle attribute “ReleaseState”, and the default value is null:

sqlplus system/manager@intralink @set_common_name_1155075.sql \

ReleaseState l ‘’ NO