cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

How to compare one attribute to another attribute with a webject query?

RandyJones
20-Turquoise

How to compare one attribute to another attribute with a webject query?

Windchill 9.1 M070

I am attempting to create a webject that will query for epmdocumentmasters whose CADName != name. However the webject query syntax seems to assume the value on the rh side of the comparison operator is a literal string instead of an attribute name. For example:

<ie:param name="where" data="(CADName!=name)"/">

The above will compare the attribute CADName to the literal string "name" which is NOT what I want. I want to compare epmDocMaster.CADName to epmDocMaster.name. How do I do this?

Full webject is here:

  <ie:webject name="Query-Objects" type="OBJ">
                 <ie:param name="INSTANCE" data="&lt;%=com.infoengine.au.NamingService.getVMName()%">" delim="!" valueSeparator="!"/>
                 <ie:param name="authorization" data="$(@SERVER[]AUTHORIZATION[0])"/">
                 <ie:param name="type" data="wt.epm.EPMDocumentMaster"/">
                 <ie:param name="where" data="(containerName=Simba*)"/">
                 <ie:param name="where" data="(CADName!=name)"/">
                 <ie:param name="attribute" data="CADName,name,containerName" delim=","/">
                 <ie:param name="group_out" data="objectsSearched"/">
  </ie:webject>

Thanks

--
3 REPLIES 3


Randy

You need to surround the CADName value with single quotes.

For example,
<ieSmiley Tonguearam name="WHERE" data="CADName!='name"/">

That should do it.

David Graham
Windchill Developer/Administrator
Emhart Glass SA
Mobil: 203.376.3144

Sent from somewhere on planet Earth using my iPhone

On Jul 23, 2013, at 6:48 AM, "Randy Jones" <->
wrote:

> Windchill 9.1 M070
>
> I am attempting to create a webject that will query for
epmdocumentmasters whose CADName != name. However the webject query syntax
seems to assume the value on the rh side of the comparison operator is a
literal string instead of an attribute name. For example:
>
> <ieSmiley Tonguearam name="where" data="(CADName!=name)"/">
>
> The above will compare the attribute CADName to the literal string "name"
which is NOT what I want. I want to compare epmDocMaster.CADName to
epmDocMaster.name. How do I do this?
>
> Full webject is here:
>
> <ie:webject name="Query-Objects" type="OBJ">
> <ieSmiley Tonguearam name="INSTANCE"&lt;br"/>data="<%=com.infoengine.au.NamingService.getVMName()%>" delim="!"
valueSeparator="!"/>
> <ieSmiley Tonguearam name="authorization" data="$(@SERVER&lt;br"/>[]AUTHORIZATION[0])"/>
> <ieSmiley Tonguearam name="type" data="wt.epm.EPMDocumentMaster"/">
> <ieSmiley Tonguearam name="where" data="(containerName=Simba*)"/">
> <ieSmiley Tonguearam name="where" data="(CADName!=name)"/">
> <ieSmiley Tonguearam name="attribute"&lt;br"/>data="CADName,name,containerName" delim=","/>
> <ieSmiley Tonguearam name="group_out" data="objectsSearched"/">
> </ie:webject>
>
> Thanks
>
> --


Randy

Please ignore my post.
I misunderstood your question

You can get this info with the following SQL if that helps

select CADName,name,ida2a2,Documentnumber from EPMDocumentMaster where
CADName<>NAME;

David Graham
Windchill Developer/Administrator
Emhart Glass SA
Mobil: 203.376.3144

Sent from somewhere on planet Earth using my iPhone

On Jul 23, 2013, at 6:48 AM, "Randy Jones" <->
wrote:

> Windchill 9.1 M070
>
> I am attempting to create a webject that will query for
epmdocumentmasters whose CADName != name. However the webject query syntax
seems to assume the value on the rh side of the comparison operator is a
literal string instead of an attribute name. For example:
>
> <ieSmiley Tonguearam name="where" data="(CADName!=name)"/">
>
> The above will compare the attribute CADName to the literal string "name"
which is NOT what I want. I want to compare epmDocMaster.CADName to
epmDocMaster.name. How do I do this?
>
> Full webject is here:
>
> <ie:webject name="Query-Objects" type="OBJ">
> <ieSmiley Tonguearam name="INSTANCE"&lt;br"/>data="<%=com.infoengine.au.NamingService.getVMName()%>" delim="!"
valueSeparator="!"/>
> <ieSmiley Tonguearam name="authorization" data="$(@SERVER&lt;br"/>[]AUTHORIZATION[0])"/>
> <ieSmiley Tonguearam name="type" data="wt.epm.EPMDocumentMaster"/">
> <ieSmiley Tonguearam name="where" data="(containerName=Simba*)"/">
> <ieSmiley Tonguearam name="where" data="(CADName!=name)"/">
> <ieSmiley Tonguearam name="attribute"&lt;br"/>data="CADName,name,containerName" delim=","/>
> <ieSmiley Tonguearam name="group_out" data="objectsSearched"/">
> </ie:webject>
>
> Thanks
>
> --

Hi Randy,


In your syntax, IE is going to see "name" as a literal string for comparison. I suspect that you're trying to pass it a variable called "name" that your retrieving elsewhere.



If you're getting the "name" value from a form or passing it from a Java application that's executing the webject, this syntax should work.



<ie:param name="WHERE" data="CADName='$(@FORM[]name[])">



Hope that helps!



In Reply to Randy Jones:


Windchill 9.1 M070

I am attempting to create a webject that will query for epmdocumentmasters whose CADName != name. However the webject query syntax seems to assume the value on the rh side of the comparison operator is a literal string instead of an attribute name. For example:

<ie:param name="where" data="(CADName!=name)"/">

The above will compare the attribute CADName to the literal string "name" which is NOT what I want. I want to compare epmDocMaster.CADName to epmDocMaster.name. How do I do this?

Full webject is here:

<ie:webject name="Query-Objects" type="OBJ">
<ie:param name="INSTANCE" data="&lt;%=com.infoengine.au.NamingService.getVMName()%">" delim="!" valueSeparator="!"/>
<ie:param name="authorization" data="$(@SERVER[]AUTHORIZATION[0])"/">
<ie:param name="type" data="wt.epm.EPMDocumentMaster"/">
<ie:param name="where" data="(containerName=Simba*)"/">
<ie:param name="where" data="(CADName!=name)"/">
<ie:param name="attribute" data="CADName,name,containerName" delim=","/">
<ie:param name="group_out" data="objectsSearched"/">
</ie:webject>

Thanks

--
Announcements


Top Tags