Community Tip - You can change your system assigned username to something more personal in your community settings. X
Good Afternoon Team,
Can you help me how we can get the StringValue.Value2 from part if it is null
here is the query I am running right now which gives only those parts which Have StringValue.Value2 something in DB
from WTPartmaster pm, WTPart p ,PDMLINKPRODUCT prd, StringValue sv, STRINGDEFINITION sd
where pm.IDA2A2 = p.IDA3MASTERREFERENCE and pm.IDA3CONTAINERREFERENCE = prd.IDA2A2
and sd.NAME = 'test1' and sv.IDA3A4 = p.IDA2A2 and p.versionsortida2versioninfo=(select max (c.versionsortida2versioninfo)
from wcadmin.wtpart c
where c.ida3masterreference = p.ida3masterreference) and p.LATESTITERATIONINFO = 1 and sd.ida2a2 = sv.IDA3A6 ;
I'm not quite following this part "from wcadmin.wtpart c" since I don't see a Windchill table called "wcadmin", but I think you need to left join the string value table and possibly even string definition table onto the rest of your query. This will allow all entries from the main query to be listed, even if there are null values in the joined tables.
I'm assuming this is the part of the query you want to modify?
and sd.NAME = 'test1' and
Try changing it to this and see what you get:
and (sd.NAME = 'test1' or sd.NAME = '') and
or, if the value is actually null change it to this:
and (sd.NAME = 'test1' or sd.NAME is null) and
See what happens.
Left outer join is the option, like Tom said