<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Windchill query with INSTR in Windchill Customization</title>
    <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/845183#M2589</link>
    <description>&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/559674"&gt;@IvanFeofilov&lt;/a&gt;, ignore that. There is confusion in your request. We know you doing a regular old QuerySpec in Java. I think we've given you what you need to start experimenting on your own right?&lt;/P&gt;</description>
    <pubDate>Tue, 20 Dec 2022 14:38:35 GMT</pubDate>
    <dc:creator>avillanueva</dc:creator>
    <dc:date>2022-12-20T14:38:35Z</dc:date>
    <item>
      <title>Windchill query with INSTR</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/844640#M2580</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;Could you please share an example of using Windchill Java api with function INSTR .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SQL e.g.&lt;BR /&gt;SELECT count(*)&lt;BR /&gt;FROM LCSPalette, LCSProduct&lt;BR /&gt;WHERE INSTR(LCSPalette.PTC_STR_12TYPEINFOLCSPALETTE, LCSProduct.PTC_STR_21TYPEINFOLCSPRODUCT) &amp;gt; 1&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 13:15:03 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/844640#M2580</guid>
      <dc:creator>IvanFeofilov</dc:creator>
      <dc:date>2024-03-15T13:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Windchill query with INSTR</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/844661#M2581</link>
      <description>&lt;P&gt;This is not really part of Windchill API per say but core Java. Its the indexOf() method.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html#indexOf(java.lang.String)" target="_blank"&gt;https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html#indexOf(java.lang.String)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;ahh, but I see you are looking for building a QuerySpec? Then you want wt.query.SQLFunction class. It has all the functions listed there.&lt;/P&gt;
&lt;P&gt;In your installation, you can view the JavaDoc API here:&lt;/P&gt;
&lt;P&gt;&amp;lt;hostname&amp;gt;/Windchill/wt/clients/library/api/wt/query/SQLFunction.html&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 13:23:05 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/844661#M2581</guid>
      <dc:creator>avillanueva</dc:creator>
      <dc:date>2022-12-16T13:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Windchill query with INSTR</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/844881#M2582</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/27334"&gt;@avillanueva&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;He maybe means the&amp;nbsp;wt.query.QuerySpec&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've never found documentation for it.&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/559674"&gt;@IvanFeofilov&lt;/a&gt;&amp;nbsp;needs to experiment with the definition of query conditions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PetrH&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 07:35:58 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/844881#M2582</guid>
      <dc:creator>HelesicPetr</dc:creator>
      <dc:date>2022-12-19T07:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Windchill query with INSTR</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/844883#M2583</link>
      <description>&lt;P&gt;Yes,&lt;/P&gt;&lt;P&gt;Interesting in example of &lt;SPAN&gt;&lt;SPAN class=""&gt;wt.query.SQLFunction&lt;/SPAN&gt;&lt;/SPAN&gt; with &lt;SPAN&gt;&lt;SPAN class=""&gt;MINUS or INTERSECT Compound Statements (wt.query.CompoundQuerySpec)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 07:48:36 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/844883#M2583</guid>
      <dc:creator>IvanFeofilov</dc:creator>
      <dc:date>2022-12-19T07:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Windchill query with INSTR</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/844893#M2584</link>
      <description>&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/559674"&gt;@IvanFeofilov&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nice example, but it is not official documentation :D.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This way you can go through all "query" classes and if you are lucky you can find better examples.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PetrH&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 09:01:58 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/844893#M2584</guid>
      <dc:creator>HelesicPetr</dc:creator>
      <dc:date>2022-12-19T09:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Windchill query with INSTR</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/844973#M2585</link>
      <description>&lt;P&gt;Are you trying to use the "In String" function in a query builder report? Database Functions for query builder are documented here:&amp;nbsp;&lt;A href="http://support.ptc.com/help//wnc/r12.1.0.0/en/index.html#page/Windchill_Help_Center/querybuilder/QBSelectOrConstrainDatabaseFunction.html" target="_blank"&gt;http://support.ptc.com/help//wnc/r12.1.0.0/en/index.html#page/Windchill_Help_Center/querybuilder/QBSelectOrConstrainDatabaseFunction.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 19:02:08 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/844973#M2585</guid>
      <dc:creator>joe_morton</dc:creator>
      <dc:date>2022-12-19T19:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Windchill query with INSTR</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/845058#M2586</link>
      <description>&lt;P&gt;Yes, but how I can transform QML into Windchill query API?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 04:41:46 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/845058#M2586</guid>
      <dc:creator>IvanFeofilov</dc:creator>
      <dc:date>2022-12-20T04:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Windchill query with INSTR</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/845153#M2588</link>
      <description>&lt;P&gt;Are you kidding?&lt;/P&gt;&lt;P&gt;I mean using Windchill Java QueryStatement&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 13:24:44 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/845153#M2588</guid>
      <dc:creator>IvanFeofilov</dc:creator>
      <dc:date>2022-12-20T13:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Windchill query with INSTR</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/845183#M2589</link>
      <description>&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/559674"&gt;@IvanFeofilov&lt;/a&gt;, ignore that. There is confusion in your request. We know you doing a regular old QuerySpec in Java. I think we've given you what you need to start experimenting on your own right?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 14:38:35 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/845183#M2589</guid>
      <dc:creator>avillanueva</dc:creator>
      <dc:date>2022-12-20T14:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Windchill query with INSTR</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/845313#M2590</link>
      <description>&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/27334"&gt;@avillanueva&lt;/a&gt;I always could experement for now have no time. So I asked about an example of QuerySpec&amp;nbsp; with two arguments function, first argument from result select.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 04:48:11 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/845313#M2590</guid>
      <dc:creator>IvanFeofilov</dc:creator>
      <dc:date>2022-12-21T04:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Windchill query with INSTR</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/845341#M2591</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/559674"&gt;@IvanFeofilov&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Christmas is coming &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The sql function what you need is it an IN_STRING? it has just different internal name in the SQLFunction API but it could be what you need.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HelesicPetr_0-1671606087260.png" style="width: 497px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/72989iC459B8D97B794DC2/image-dimensions/497x41?v=v2" width="497" height="41" role="button" title="HelesicPetr_0-1671606087260.png" alt="HelesicPetr_0-1671606087260.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I share an example, how the function can be used in querySpec, but with different function types.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;QuerySpec querySpec = new QuerySpec();
			querySpec.setAdvancedQueryEnabled(true);

			int processQueueINT = querySpec.appendClassList(ProcessingQueue.class, true);
			int queryEntryINT = querySpec.appendClassList(QueueEntry.class, true);
			ClassAttribute classAttribute = new ClassAttribute(ProcessingQueue.class, "name");
			SQLFunction sqlFunction1 = SQLFunction.newSQLFunction("LENGTH", new ColumnExpression[]{classAttribute});
			SQLFunction sqlFunction2 = SQLFunction.newSQLFunction("SUB_STRING", new ColumnExpression[]{classAttribute, sqlFunction1, new ConstantExpression(1)});
			SearchCondition not_in = new SearchCondition(sqlFunction2, "NOT IN", new ArrayExpression(new String[]{"H", "L", "M"}));
			SearchCondition like = new SearchCondition(ProcessingQueue.class, "name", "LIKE", "PublisherQueue%");
			SearchCondition procesingID = new SearchCondition(ProcessingQueue.class, "thePersistInfo.theObjectIdentifier.id", QueueEntry.class, "queueRef.key.id");

			querySpec.appendWhere(not_in, processQueueINT);
			querySpec.appendAnd();
			querySpec.appendWhere(like, processQueueINT);
			querySpec.appendAnd();
			querySpec.appendWhere(procesingID, processQueueINT, queryEntryINT);

QueryResult jobQS = PersistenceServerHelper.manager.query(querySpec);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this can help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PetrH&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 07:24:14 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Windchill-query-with-INSTR/m-p/845341#M2591</guid>
      <dc:creator>HelesicPetr</dc:creator>
      <dc:date>2022-12-21T07:24:14Z</dc:date>
    </item>
  </channel>
</rss>

