title: Sybase ASE xmltable - pattern not working
body: <p>I am trying the following with Sybase ASE 15.0.2 but finding it hard to get through:</p>
  
  <p>The motive is to extract the contents of &lt;tables&gt; tag. Could someone help me with this?</p>
  
  <p>Refer - <a href="http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc30020.1502/html/xmlb/CFHIDCJC.htm" rel="nofollow">http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc30020.1502/html/xmlb/CFHIDCJC.htm</a></p>
  
  <pre><code>declare @purgeTableInfo varchar(16300)
  select @purgeTableInfo = 
      '&lt;purge&gt;
          &lt;start-time&gt;00:00:000&lt;/start-time&gt;
          &lt;end-time&gt;03:00:000&lt;/end-time&gt;
          &lt;tables&gt;
              &lt;table&gt;
                  &lt;table_name&gt;table1&lt;/table_name&gt;
                  &lt;owner&gt;dbo&lt;/owner&gt;
                  &lt;columns&gt;
                      &lt;column&gt;
                          &lt;column_name&gt;column1&lt;/column_name&gt;
                          &lt;column_value&gt;121212xdfsdsdsdsd&lt;/column_value&gt;
                          &lt;column_condition&gt;like&lt;/column_condition&gt;
                      &lt;/column&gt;
                      &lt;column&gt;
                          &lt;column_name&gt;column2&lt;/column_name&gt;
                          &lt;column_value&gt;121212xdfsdsdsdsd&lt;/column_value&gt;
                          &lt;column_condition&gt;like&lt;/column_condition&gt;
                      &lt;/column&gt;
                  &lt;/columns&gt;
              &lt;/table&gt;
          &lt;/tables&gt;
      &lt;/purge&gt;'
          select * 
            from xmltable('/purge/tables/table/columns/column'
                      passing @purgeTableInfo
                      columns columnName varchar(255) path 'column_name',
                              tableName varchar(255) pattern '../../table_name') as purgeInputDetails
  </code></pre>