Skip to main content
10-Marble
February 5, 2015
Question

Getting query to return even with null (empty) valued attributes

  • February 5, 2015
  • 2 replies
  • 4839 views

Greetings,

This may be a stupid question, how can I get my query to return results even if one of the attributes has no value?

 

I have a query that works fine until I ask it to select and attribute where the value is empty.

 

Thanks for the help,

-Cam

2 replies

1-Visitor
February 5, 2015

Are you joining different types on one of the potentially null attributes? If so try Outer Join Against.

Otherwise, maybe it's the Criteria?

cswaner10-MarbleAuthor
10-Marble
February 5, 2015

Keir,

Specifically, I am trying to get a string value from a part for a specific attribute.

So, in "From" I add wt.part.WTPart, wt.iba.value.StringValue, and wt.iba.definition.AttributeDefinition.

Then, I join String Value to Part via ibaholder reference

Then, I join Attribute Definition to String Value via Definition Reference

I also have outer join between the String Value and Part.

I select the value from the String Value and set the criteria to only pull the attribute definition name for the specific attribute.

This works fine until I choose a part that has no value for the string. Something to do with the Joins?

-Cam

1-Visitor
February 5, 2015

If you're only after IBA values, then you should be able to Select from the WTPart. (IBA's should be an available attribute of WTPart when defining the Select).

If you keep the other types in the Query, then I would play with the Outer Join Against to allow null values.

MarcoTosin
21-Topaz I
21-Topaz I
February 6, 2015

Cameron,

joining types in Windchill is quite difficult to understand.

Last week I had a couple of days of training with a PTC consultant on query builder, so I can give you some advice.

Not all types of object could be join directly.

If you want to know something about, you have to enable Customization Icon in the navigator bar1+-+Customization+Tools.PNG

Then pick Tools and select Modeled Objects.

Now in the Column Descriptors you can do a Search in table with the type, for example Wtpart.

Once you have found your type, select Information, Java Information tab and finally UML Diagram.

2-+Modeled+Objects.PNG

Marco
cswaner10-MarbleAuthor
10-Marble
February 6, 2015

Marco,

Is there a way to control who has access to the Customization Utility?

-Cam

MarcoTosin
21-Topaz I
21-Topaz I
February 6, 2015

Cameron,

as you can see in the first image attached to my previous comment, you have to be site admin to enable the preference.

Other roles cannot.

Marco