CLI Reference > Workflows and Documents Commands > im copyquery
  
im copyquery
copies the properties and constraints of a query and allows you to rename it as your own
Synopsis
im copyquery[--image=[none|default|<path>] [--copyColumnsFromQuery[=[user:]query] [--fields=field,field,...] [--[no]sortAscending][--sortField= field] [--image=[none|default|path][--description=value][--shareWith=u=user1[:modify],user2[:modify],.. ;g=group1[:modify],group2[:modify],..] [--name=value] [--hostname=value] [--queryDefinitionFile=value][--queryDefinition=query][--[no]referenceOriginalQuery][--sharedAdmin] [--port=value] [--password=value] [--user=value][(-?|--usage)][(-g|--gui)][(-F value|--selectionFile=value)][--quiet][--settingsUI=[gui|default]][--status=[none|gui|default]] [(-N|--no)][(-Y|--yes)][--[no]batch][--cwd=value ][--forceConfirm=[yes|no]][user:]query
Description
im copyquery copies the properties and constraints of a query and allows you to rename it as your own.
For example,
im copyquery --name="Release 2.0 Docs Issues Hours" --fields="State","Estimated Hours","Actual Hours","Assigned User" "Release 2.0 Docs Issues"
copies the existing Release 2.0 Docs Issues query to create a new query that shows the estimated and actual hours for the same issues.
Note the following about using the im copyquery command:
Copying a Quick Query creates a named query that can be shared with others.
If the query you are copying is a system provided object, the --sharedAdmin option is not set in the copy.
Unique names must be used for all queries created by you.
If you do not specify a different name for the new query, Windchill RV&S adds Copy of as a prefix to the query name, for example, Copy of Cosmos Critical Defects.
You cannot query on configuration management project fields.
Displayed date fields do not change based on the time zone that a user is operating in; however, displayed date/time fields and time entries vary based on the time zone that a user is operating in.
When specifying a date range in a query, all dates are treated as timestamps, converted to the time zone on the Windchill RV&S Server, and then truncated to a date-only format. The resulting date-only format is then converted to a Structured Query Language (SQL) statement format on the Windchill RV&S Server, and the query is run based on the time zone of the server. If the user defining the date range is not in the same time zone as the Windchill RV&S Server, a day can be lost or gained at either end of the defined range. The rollback of dates can cause the query results to vary.
Important:
The date range conversion does not cause any problems when the user is in the same time zone as the Windchill RV&S Server.
For example, if the Windchill RV&S Server is in the America/New_York time zone and the following query date range is defined by a user in Germany: Jan 1, 2006 to Jan 31, 2006.
The final conversion of the date range is: Dec 31, 2005 06:00:00 AM GMT+01:00 to Jan 31, 2006 06:00:00 AM GMT+01:00.
To avoid any date rollbacks when working with query date ranges in Windchill RV&S, PTC recommends that users specify the time zone that is used by the Windchill RV&S Server they are connecting to.
Symbolic dates are evaluated on the Windchill RV&S Client’s time zone.
Because dynamically computed fields are not stored in the database, dynamically computed short text fields cannot be located with an all text field search in the Windchill RV&S Client. To search for dynamically computed short text fields, create a query that includes a specific “field contains” comparison. For more information about computed fields, see your administrator.
Options
This command takes the universal options available to im commands, as well as some general options. See the options reference page for descriptions.
--copyColumnsFromQuery[=[user:]query]
specifies a different query to copy the column configuration from to use as the default for the new query. If you do not specify a query to copy from, the new query uses the column configuration of the original query.
* 
--fields=field, field,..., --[no]sortAscending, and --sortFieldfield= are not mandatory, but if specified, they overwrite the current default column configuration.
--fields=field,field,...
specifies the fields to use as the default columns for your query. This overrides the current default columns.
--[no]sortAscending
specifies the sort direction that issues are displayed in. This overrides the current default sort direction.
--sortField=field
specifies the field that issues are sorted by. This overrides the current default sort field.
--shareWith =u=user1[:modify],user2[:modify],.. ;g=group1[:modify],group2[:modify],..
specifies the users and groups that can use and modify the query. Your administrator defines users and groups.
--image=[none|default|path ]
specifies whether an image appears for the new query.
--image=nonedoes not specify an image for the query.
--image=default specifies the default funnel image for the query.
--image=path specifies the path and name of a custom image for the query, for example, .
c:\images\defect_icon.gif
* 
Images must be GIF or JPEG format, and no larger than 16 by 24 pixels.
--shareWith==user1[:modify],user2[:modify],..;g=group1[:modify],group2[:modify],..
specifies the users and groups that can use and modify the query. Your administrator defines users and groups.
--description=value
specifies a short description for the new query.
--name=value
specifies the name of the new query.
--[no]referenceOriginalQuery
specifies whether the original query definition is referenced in the new query as a subquery. If the original query definition is referenced, any changes to the original query definition are reflected in the new query. The default is to copy the original query, not reference it.
--queryDefinition=query
specifies a string to define the query constraints. For details of the query format, see the im createquery reference page.
* 
To reference the original query definition in the new query so that any changes to the original query definition are reflected in the new query, define <subquery> as subquery[OriginalQuery].
--queryDefinitionFile=value
specifies a file that contains the complete definition of the query. See --queryDefinition for the file format.
--sharedAdmin
specifies the query as a system provided object (objects within the Windchill RV&S object model that support solution definition and management, as well as workflow migration). For more information, see your administrator.
* 
Once a user object is converted to a system provided object, you cannot revert it to a user object again.
[user:]query
specifies the name of the user who the copied query belongs to and the query name, for example, jhoyt:Cosmos Critical Defects. You do not have to specify the user name, but you must specify the query name. This option is useful when multiple users have the same name for a query.
* 
Windchill RV&S initially assumes that text before the colon (:) is a user name and text after it is a query name. If Windchill RV&S fails to find a matching user name and query name, it searches for a query name matching the exact text. For example, if you type jhoyt:CosmosDefects, Windchill RV&S searches for the CosmosDefects query created by jhoyt. If Windchill RV&S cannot find the query and/or user, it searches for the jhoyt:CosmosDefects query created by any user.
See Also
Commands: im createquery, im deletequery, im editquery, im viewquery, im queries
Miscellaneous: options