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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

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

RandyJones
19-Tanzanite

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

--
Top Tags