Insert: insert

Use the insert command to execute a single item insert of the specified values.

The insert statement executes a single item insert if the values are specified in-line or a transacted set of inserts if the values are specified though an input file.

The value clause specification should match that of the property list specification, whether in line or provided through the input file. The types and the number of values should match their corresponding property specifications.

The items are created in the folder described in the folder hierarchy argument of the set statement. If no folder hierarchy is provided, the items are created in the root folder of the selected view. The items are created and saved to the StarTeam Server in a server transaction. All the items are successfully created or none are created. If the insert succeeds, a check-in change package is created, which records the newly created items and their property values. Values that contain spaces should be enclosed in double quotes. This command has been modeled on the standard SQL Insert syntax.

Note: Only user modifiable properties can be specified for a value update. Run the describe type command to identify the set of user modifiable properties.

Syntax

The syntax for this command is:

stcmd{Ex} insert into type ( propertyName, propertyName,... )
revisions | values [ ( value, value,... ) |
from ‘filePath’ { separator ‘fieldSeparator’} {-pattern "pattern"} ]
{output* | {propertyName,...} | filter='myFilter' into "outputFilePath"
[-p "userName:password@hostName:endpoint/projectName/[viewName/][folderHierarchy/]"]

Parameters

For information about the command parameters, refer to Operation Parameters.

Example

The following is an example of insert from file:

stcmdEx insert into story (name, tag) from c:\temp\story.csv separator “|”

The contents of story.csv would look like this

"This is a story name"|101.103
 "This is a second story"|105

Whatever the user modifiable property names you specify in the command must match up in order with the content of the CSV file. Note that the separator in the file must match what you tell the command as the separator.