Use delete to delete all objects that satisfy the WHERE clause. The syntax of the where clause is identical to select, update or delete, and is fully described in the select command section. A check-in change package is created that records the set of items that were deleted. The items are deleted in a server transaction. As a result, either all items are deleted (and the transaction succeeds) or not a single item is deleted and the transaction fails. If the transaction fails, it is rolled back. Values that contain spaces should be enclosed in double quotes. This command has been modeled on the standard SQL DELETE syntax.
The syntax for this command is:
stcmd{Ex} delete type {local} {output* | {propertyName,...} |
filter='myFilter' into "outputFilePath" {separator 'fieldSeparator'}}
where {{ attached-label = 'labelName' } | { query = 'myquery' } |
propertyName relation value and/or propertyName relation value and/or...}
{for} {folder = 'myfolder' {recurse} or folder = 'myfolderhierarchy'
{recurse}
or folder = . {recurse}} or ...}
type { File | Folder | ChangeRequest | Requirement | Task | Topic |
CustomComponentTypeName | Trace | ChangePackage }
[–epwdfile “passwordfilepat”]
[-p "userName:password@hostName:endpoint/projectName/[viewName/][folderHierarchy/]"]
Specifies the StarTeam folder name in the current view.
If there are multiple folders with the same name, the command performs the action on all folders with that name.
Specifies the folder hierarchy in the "/" format.
Start from the root folder and end in a branch folder. For example: /StarDraw/SourceCode/On-line Help/.
The INSERT, DELETE, and UPDATE commands log the selected properties of the inserted items to a log file. The property values are separated by the specified fieldSeparator, or "|" if a separator is not specified.
Implies the current working folder, requiring the tool to find StarTeam folders with paths mapping to the current working folder.
The Command processor must be running inside the StarTeam folder hierarchy.
Specifies the saved StarTeam query name for the type.
It acts as the equivalent of a compound where clause of a SQL statement, such as combinations of relations and operators.
If no query name is specified, the command performs the action on all objects of the type.
The full syntax is:
stcmd -p "userName:password@hostName:endpoint/projectName/[viewName/][folderHierarchy/]"
For example:
stcmd -p “bsmith:rocketfive@orion:49201/StarDraw/StarDraw/SourceCode/”
The -epwdfile keyword specifies the path to the file that contains the encrypted password. Like -pwdfile , -epwdfile replaces the password being used as part of the -p or -s option, preventing others from seeing the user's password on the command line. The full syntax is: -epwdfile "filePath" .
The -pwdfile is supported for backward compatibility. Un-encrypted passwords stored using older versions of stcmd are read. However, passwords cannot be stored to files using -pwdfile anymore.
In this case, the syntax of -p or -s reduces to -p "username@hostname:port/... -epwdfile "fullyQualifiedPathToPasswordFile"".
The following is the syntax of the commands that can be used to store an encrypted password.
Use the following syntax to be prompted for the password that will be encrypted and stored in a file.
stcmd store-password -epwdfile "filePath"
stcmd store-password -epwdfile "filePath" -password "password"
After an encrypted password is stored, other stcmd commands can specify -epwdfile "filePath"' as parameters. For example:
stcmd delete-local -p "JMarsh@Orion:1024/StarDraw/StarDraw/SourceCode" -epwdfile "C:\estuff\myfile.txt" -filter "N" "*"
If -p or -s and -epwdfile are used together, then the parameter :password must be omitted from -p. For example:
-p user@hostname:port/projectName.viewName -epwdfile "pathToPasswordFile"
The following example deletes all change requests with an open status from the StarDraw project StarDraw view.
stcmd connect Administrator:Administrator@localhost:49201 stcmd set project = ‘StarDraw’ view = ‘StarDraw’ stcmd delete changerequest where query = "Status = Open" disconnect