Query utilities
query_xml
Creates, modifies, writes, deletes, and runs queries from an XML formatted file. Syntax query_xml [-u=user-id {-p=password | -pf=password-file} -g=group] -v -f=xml-command-file [-o=output-file-name] [-h] Arguments -u= Specifies the user ID. This is a user with Teamcenter administration privileges. If this argument is used without a value, the operating system user name is used. Note If Security Services single sign-on (SSO) is enabled for your server, the -u and -p arguments are authenticated externally through SSO rather than being authenticated against the Teamcenter database. If you do not supply these arguments, the utility attempts to join an existing SSO session. If no session is found, you are prompted to enter a user ID and password. -p= Specifies the password. If used without a value, the system assumes a null value. If this argument is not used, the system assumes the user-ID value to be the password. This argument is mutually exclusive with the -pf argument. -pf Specifies the password file. If used without a value, the system assumes a null value. If this argument is not used, the system assumes the user-ID value to be the password. For more information about managing password files, see Manage password files. This argument is mutually exclusive with the -p argument. -g= Specifies the group associated with the user. If used without a value, the user's default group is assumed. -f= xml-command-file Specifies the fully qualified name of the XML file used to control processing. This argument is mandatory. -o= output-file-name Specifies the name of the file to which the output from the write and execute processes are written. This argument is optional. If unspecified, the output is sent to the console. This parameter is required for the execute and execute_tuple command types. The -o argument specified for outputting a generated query result file does not support appending the results of multiple queries to the specified output file. If you have more than one query specified in the query_xml utility, only the last query is included in the defined output file. The documentation for -o usage is correct for a single query but does not describe the scenario or required parameter for multiple queries and output files. If you execute multiple queries using query_xml, add a parameter called outputFileName to the query definition to specify a unique output file for each query. Because queries can result in structurally different XML content per context, queries cannot be appended together and must be treated as unique files per query. For example: Copy Copy
<!ELEMENT name EMPTY>
<!ATTLIST name value CDATA #REQUIRED>
<!ELEMENT description EMPTY>
<!ATTLIST description value CDATA #REQUIRED>
<!ELEMENT class EMPTY>
<!ATTLIST class value CDATA #REQUIRED>
<!ELEMENT clauses_real (#PCDATA)>
<!ELEMENT clauses_display (#PCDATA)>
<!ELEMENT uniqueid EMPTY>
<!ATTLIST uniqueid value CDATA #REQUIRED>
<!ELEMENT iflag EMPTY>
<!ATTLIST iflag value CDATA #REQUIRED>
<!ELEMENT ImanQueryDefinition (name, description, class, clauses_real,
clauses_display?, uniqueid, iflag)>
<!ELEMENT query_input_parameter EMPTY>
<!ATTLIST query_input_parameter name CDATA #REQUIRED>
<!ATTLIST query_input_parameter value CDATA #REQUIRED>
<!ELEMENT query_pff_post EMPTY>
outputFileName CDATA #REQUIRED> <!-- file to write data (no longer used)-->
Copy
<!ELEMENT ImanQueryCommandFile (ImanQueryCommand)*>
<!ATTLIST ImanQueryCommandFile site_name CDATA #IMPLIED
site_id CDATA #IMPLIED>
]>
Source: https://docs.sw.siemens.com/documentation/external/PL20251212545240207/en-US/tc_help/utilities_reference/jhb1737253704745/query_xml.html · retrieved Fri Jul 31 2026 00:00:00 GMT+0000 (Coordinated Universal Time)