Showing results for 
Search instead for 
Do you mean 
Reply

How to Run TC query from TC command Prompt?

Hello Experts,

 

is it possible to run Teamcenter query from TC command Prompt?

 

Please help if possible.

 

Regards,

Rathore

6 REPLIES

Re: How to Run TC query from TC command Prompt?

Just want to add here, I tried 1 thing but that is not working for me. 

 

Actually I am trying to run below "run_query.xml” files by following command for Admin-Employee query but getting below errors.

 

Please tell where I am wrong.

 

Command------

D:\Siemens\Teamcenter10\bin>query_xml -v -u=infodba -p=infodba -g=dba -f="C:\Documents\New folder\run_query.xml"

 

run_query.xml filke------

<?xml version="1.0" encoding="UTF-8"?>
<ImanQueryCommandFile site_name="IMC--1945665868" site_id="-1945665868">
<ImanQueryCommand command="execute">
<name value="Admin - Employee Information"/>
<query_input_parameter name="PersonName" value="*"/>
<query_pff_post pffName="pff1" outputFileName="C:\Documents\outputpff1.xml"/>
</ImanQueryCommand>
</ImanQueryCommandFile>

 

output------

 

Logging in...

Errror on search!
error code is ierr Not OK
for query ....
ImanQueryCommand
Num Found = 0
Errror on search!
error code is ierr Not OK

Writing search results in to file pointed by pff !
Errror on tupple formatting!
error code is ierr Not OK

Re: How to Run TC query from TC command Prompt?

looks like the run_query.xml does not contain parameter defining objects of which type/class needs to be searched.

Re: How to Run TC query from TC command Prompt?

One thing I noticed is that the path to your output file isn't formatted to be compatible with Java syntax. That is, you should use double backslashes where you would normally see a single one in Windows:

 

<query_pff_post pffName="pff1" outputFileName="C:\Documents\outputpff1.xml"/>

 

should be:

 

<query_pff_post pffName="pff1" outputFileName="C:\\Documents\\outputpff1.xml"/>

 

 

Arden Bedell | Teamcenter Wonk | Applied CAx, LLC

Re: How to Run TC query from TC command Prompt?

You also need to change this line:

 

<query_input_parameter name="PersonName" value="*"/>

 

to this:

 

<query_input_parameter name="Person Name" value="*"/>

Arden Bedell | Teamcenter Wonk | Applied CAx, LLC

Re: How to Run TC query from TC command Prompt?

Sweet. thanks everyone for their quick replies.

 

@ardenb thanks. Command was executed successfully after giving the space between Person and name.

 

Also I have changed the pff format to "Admin - Objects By Status" which I find from one GTAC post, which somehow giving little bit clear outcome.

 

But still I am facing following issues and doubts.

 

  1. how to create pff (report format) / how to know what all pff (report format) are available to use.
  2. query_xml***.syslog. It is creating randomly. not sure why and how it is not generating for every execution.

 

Please help me with above points.

 

Regards,

Rathore

 

Re: How to Run TC query from TC command Prompt?

1. PFF - When you run query in "My Teamcenter" you get tab of the "Search Results". on the top of this tab the 4th button from the left is named "Select PFF". pressing this button will open listbox with relevant PFFs for your query results. also new button of "Edit property formatter" is now avalable. pressing this button will allow you to edit/create PFFs. this dialog show all the Teamcenter PFFs.

 

2. The syslog somtimes deleted when there is a crash. If you will change in %tc_data%\tc_profilevars.bat the line:

rem set TC_KEEP_SYSTEM_LOG=true

to

set TC_KEEP_SYSTEM_LOG=true

 

then maybe next run the syslog will not be deleted and you would see the errors you may have.