<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – MATCH clause functions</title>
    <link>/en/sql-reference/functions/match-and-search-functions/match-clause-functions/</link>
    <description>Recent content in MATCH clause functions on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/sql-reference/functions/match-and-search-functions/match-clause-functions/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Sql-Reference: EVENT_NAME</title>
      <link>/en/sql-reference/functions/match-and-search-functions/match-clause-functions/event-name/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/match-and-search-functions/match-clause-functions/event-name/</guid>
      <description>
        
        
        &lt;p&gt;Returns a VARCHAR value representing the name of the event that matched the row.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;EVENT_NAME()
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;p&gt;Pattern matching functions must be used in &lt;a href=&#34;../../../../../en/sql-reference/statements/select/match-clause/#&#34;&gt;MATCH clause&lt;/a&gt; syntax; for example, if you call EVENT_NAME() on its own, OpenText™ Analytics Database returns the following error message:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT event_name();
ERROR:  query with pattern matching function event_name must include a MATCH clause
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

This example uses the schema defined in &lt;a href=&#34;../../../../../en/sql-reference/statements/select/match-clause/event-series-pattern-matching/#&#34;&gt;Event series pattern matching&lt;/a&gt;.

&lt;/div&gt;
&lt;p&gt;The following statement analyzes users&#39; browsing history on &lt;code&gt;website2.com&lt;/code&gt; and identifies patterns where the user landed on &lt;code&gt;website2.com&lt;/code&gt; from another Web site (Entry) and browsed to any number of other pages (Onsite) before making a purchase (Purchase). The query also outputs the values for EVENT_NAME(), which is the name of the event that matched the row.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SELECT uid,
       sid,
       ts,
       refurl,
       pageurl,
       action,
       event_name()
FROM clickstream_log
MATCH
  (PARTITION BY uid, sid ORDER BY ts
   DEFINE
     Entry    AS RefURL  NOT ILIKE &amp;#39;%website2.com%&amp;#39; AND PageURL ILIKE &amp;#39;%website2.com%&amp;#39;,
     Onsite   AS PageURL ILIKE     &amp;#39;%website2.com%&amp;#39; AND Action=&amp;#39;V&amp;#39;,
     Purchase AS PageURL ILIKE     &amp;#39;%website2.com%&amp;#39; AND Action = &amp;#39;P&amp;#39;
   PATTERN
     P AS (Entry Onsite* Purchase)
   ROWS MATCH FIRST EVENT);
 uid | sid |    ts    |        refurl        |       pageurl        | action | event_name
-----+-----+----------+----------------------+----------------------+--------+------------
   1 | 100 | 12:00:00 | website1.com         | website2.com/home    | V      | Entry
   1 | 100 | 12:01:00 | website2.com/home    | website2.com/floby   | V      | Onsite
   1 | 100 | 12:02:00 | website2.com/floby   | website2.com/shamwow | V      | Onsite
   1 | 100 | 12:03:00 | website2.com/shamwow | website2.com/buy     | P      | Purchase
   2 | 100 | 12:10:00 | website1.com         | website2.com/home    | V      | Entry
   2 | 100 | 12:11:00 | website2.com/home    | website2.com/forks   | V      | Onsite
   2 | 100 | 12:13:00 | website2.com/forks   | website2.com/buy     | P      | Purchase
(7 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/statements/select/match-clause/#&#34;&gt;MATCH clause&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/match-and-search-functions/match-clause-functions/match-id/#&#34;&gt;MATCH_ID&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/match-and-search-functions/match-clause-functions/pattern-id/#&#34;&gt;PATTERN_ID&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/statements/select/match-clause/event-series-pattern-matching/#&#34;&gt;Event series pattern matching&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: MATCH_ID</title>
      <link>/en/sql-reference/functions/match-and-search-functions/match-clause-functions/match-id/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/match-and-search-functions/match-clause-functions/match-id/</guid>
      <description>
        
        
        &lt;p&gt;Returns a successful pattern match as an INTEGER value. The returned value is the ordinal position of a match within a partition.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;MATCH_ID()
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;p&gt;Pattern matching functions must be used in &lt;a href=&#34;../../../../../en/sql-reference/statements/select/match-clause/#&#34;&gt;MATCH clause&lt;/a&gt; syntax; for example, if you call MATCH_ID() on its own, OpenText™ Analytics Database returns the following error message:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT match_id();
ERROR:  query with pattern matching function match_id must include a MATCH clause
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

This example uses the schema defined in &lt;a href=&#34;../../../../../en/sql-reference/statements/select/match-clause/event-series-pattern-matching/#&#34;&gt;Event series pattern matching&lt;/a&gt;.

&lt;/div&gt;
&lt;p&gt;The following statement analyzes users&#39; browsing history on a site called &lt;code&gt;website2.com&lt;/code&gt; and identifies patterns where the user reached &lt;code&gt;website2.com&lt;/code&gt; from another Web site (&lt;code&gt;Entry&lt;/code&gt; in the &lt;code&gt;MATCH&lt;/code&gt; clause) and browsed to any number of other pages (&lt;code&gt;Onsite&lt;/code&gt;) before making a purchase (Purchase). The query also outputs values for the MATCH_ID(), which represents a sequential number of the match.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SELECT uid,
       sid,
       ts,
       refurl,
       pageurl,
       action,
       match_id()
FROM clickstream_log
MATCH
  (PARTITION BY uid, sid ORDER BY ts
   DEFINE
     Entry    AS RefURL  NOT ILIKE &amp;#39;%website2.com%&amp;#39; AND PageURL ILIKE &amp;#39;%website2.com%&amp;#39;,
     Onsite   AS PageURL ILIKE     &amp;#39;%website2.com%&amp;#39; AND Action=&amp;#39;V&amp;#39;,
     Purchase AS PageURL ILIKE     &amp;#39;%website2.com%&amp;#39; AND Action = &amp;#39;P&amp;#39;
   PATTERN
     P AS (Entry Onsite* Purchase)
   ROWS MATCH FIRST EVENT);

uid | sid |    ts    |        refurl        |       pageurl        | action | match_id
----+-----+----------+----------------------+----------------------+--------+------------
1   | 100 | 12:00:00 | website1.com         | website2.com/home    | V      |          1
1   | 100 | 12:01:00 | website2.com/home    | website2.com/floby   | V      |          2
1   | 100 | 12:02:00 | website2.com/floby   | website2.com/shamwow | V      |          3
1   | 100 | 12:03:00 | website2.com/shamwow | website2.com/buy     | P      |          4
2   | 100 | 12:10:00 | website1.com         | website2.com/home    | V      |          1
2   | 100 | 12:11:00 | website2.com/home    | website2.com/forks   | V      |          2
2   | 100 | 12:13:00 | website2.com/forks   | website2.com/buy     | P      |          3
(7 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/statements/select/match-clause/#&#34;&gt;MATCH clause&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/match-and-search-functions/match-clause-functions/event-name/#&#34;&gt;EVENT_NAME&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/match-and-search-functions/match-clause-functions/pattern-id/#&#34;&gt;PATTERN_ID&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/statements/select/match-clause/event-series-pattern-matching/#&#34;&gt;Event series pattern matching&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: PATTERN_ID</title>
      <link>/en/sql-reference/functions/match-and-search-functions/match-clause-functions/pattern-id/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/match-and-search-functions/match-clause-functions/pattern-id/</guid>
      <description>
        
        
        &lt;p&gt;Returns an integer value that is a partition-wide unique identifier for the instance of the pattern that matched.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;PATTERN_ID()
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;p&gt;Pattern matching functions must be used in &lt;a href=&#34;../../../../../en/sql-reference/statements/select/match-clause/#&#34;&gt;MATCH clause&lt;/a&gt; syntax; for example, if call PATTERN_ID() on its own, OpenText™ Analytics Database returns the following error message:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT pattern_id();
ERROR:  query with pattern matching function pattern_id must include a MATCH clause
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

This example uses the schema defined in &lt;a href=&#34;../../../../../en/sql-reference/statements/select/match-clause/event-series-pattern-matching/#&#34;&gt;Event series pattern matching&lt;/a&gt;.

&lt;/div&gt;
&lt;p&gt;The following statement analyzes users&#39; browsing history on website2.com and identifies patterns where the user landed on website2.com from another Web site (Entry) and browsed to any number of other pages (Onsite) before making a purchase (Purchase). The query also outputs values for PATTERN_ID(), which represents the partition-wide identifier for the instance of the pattern that matched.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SELECT uid,
       sid,
       ts,
       refurl,
       pageurl,
       action,
       pattern_id()
FROM clickstream_log
MATCH
  (PARTITION BY uid, sid ORDER BY ts
   DEFINE
     Entry    AS RefURL  NOT ILIKE &amp;#39;%website2.com%&amp;#39; AND PageURL ILIKE &amp;#39;%website2.com%&amp;#39;,
     Onsite   AS PageURL ILIKE     &amp;#39;%website2.com%&amp;#39; AND Action=&amp;#39;V&amp;#39;,
     Purchase AS PageURL ILIKE     &amp;#39;%website2.com%&amp;#39; AND Action = &amp;#39;P&amp;#39;
   PATTERN
     P AS (Entry Onsite* Purchase)
   ROWS MATCH FIRST EVENT);


uid | sid |    ts    |        refurl        |       pageurl        | action | pattern_id
----+-----+----------+----------------------+----------------------+--------+------------
1   | 100 | 12:00:00 | website1.com         | website2.com/home    | V      |          1
1   | 100 | 12:01:00 | website2.com/home    | website2.com/floby   | V      |          1
1   | 100 | 12:02:00 | website2.com/floby   | website2.com/shamwow | V      |          1
1   | 100 | 12:03:00 | website2.com/shamwow | website2.com/buy     | P      |          1
2   | 100 | 12:10:00 | website1.com         | website2.com/home    | V      |          1
2   | 100 | 12:11:00 | website2.com/home    | website2.com/forks   | V      |          1
2   | 100 | 12:13:00 | website2.com/forks   | website2.com/buy     | P      |          1
(7 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/statements/select/match-clause/#&#34;&gt;MATCH clause&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/match-and-search-functions/match-clause-functions/event-name/#&#34;&gt;EVENT_NAME&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/match-and-search-functions/match-clause-functions/match-id/#&#34;&gt;MATCH_ID&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/statements/select/match-clause/event-series-pattern-matching/#&#34;&gt;Event series pattern matching&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
  </channel>
</rss>
