<?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 This version doesn't yet support 'LIMIT &amp;amp; IN/ALL/ANY/SOME subquery in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/This-version-doesn-t-yet-support-LIMIT-amp-IN-ALL-ANY-SOME/m-p/74615#M46408</link>
    <description>&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;One of our customers is running an old MySQL, 5.5 or 5.7. We have a very long query 300+ lines which is too long to read, what it does essentially gets orders that need to be renewed. We need to run it 24/7 and if renewal fails due to a lack of funds, the query needs to wait 6 hours before trying to renew it again.&lt;/P&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Each new order has a new and unique orderid, if an order is generated by a renewal attempt of another order, the orderid of the old order would be inserted in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;generated_by&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;field of the new order. If renewal fails due to lack of funds, it will have&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is_paid=-6&lt;/P&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;The subquery is below&lt;/P&gt;&lt;PRE&gt;AND&amp;nbsp;orderid&amp;nbsp;NOT&amp;nbsp;IN&amp;nbsp;(&lt;/PRE&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SELECT&amp;nbsp;generated_by&amp;nbsp;FROM&amp;nbsp;wtb_orders&amp;nbsp;where&amp;nbsp;is_paid=-6&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AND&amp;nbsp;created&amp;nbsp;&amp;gt;=&amp;nbsp;DATE_SUB(NOW(),&amp;nbsp;INTERVAL&amp;nbsp;6&amp;nbsp;HOUR&amp;nbsp;) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ORDER&amp;nbsp;BY&amp;nbsp;created&amp;nbsp;DESC&amp;nbsp;LIMIT&amp;nbsp;1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/P&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;That gives this error&lt;/P&gt;&lt;PRE&gt;This version doesn't yet support 'LIMIT &amp;amp; IN/ALL/ANY/SOME subquery&lt;/PRE&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;And if we don't use &amp;nbsp;ORDER&amp;nbsp;BY&amp;nbsp;created&amp;nbsp;DESC&amp;nbsp;LIMIT&amp;nbsp;1, then the renewal system will always try to renew an order because I guess each time the renewal is failing it's always creating a new entry that has an interval that doesn't fit within the rules, but I could be wrong&lt;/P&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;essentially what I want to do is to stop the renewal script from selecting the same order twice within less than 6 hours duration.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jan 2021 08:22:45 GMT</pubDate>
    <dc:creator>EthanElijah</dc:creator>
    <dc:date>2021-01-07T08:22:45Z</dc:date>
    <item>
      <title>This version doesn't yet support 'LIMIT &amp; IN/ALL/ANY/SOME subquery</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/This-version-doesn-t-yet-support-LIMIT-amp-IN-ALL-ANY-SOME/m-p/74615#M46408</link>
      <description>&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;One of our customers is running an old MySQL, 5.5 or 5.7. We have a very long query 300+ lines which is too long to read, what it does essentially gets orders that need to be renewed. We need to run it 24/7 and if renewal fails due to a lack of funds, the query needs to wait 6 hours before trying to renew it again.&lt;/P&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Each new order has a new and unique orderid, if an order is generated by a renewal attempt of another order, the orderid of the old order would be inserted in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;generated_by&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;field of the new order. If renewal fails due to lack of funds, it will have&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is_paid=-6&lt;/P&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;The subquery is below&lt;/P&gt;&lt;PRE&gt;AND&amp;nbsp;orderid&amp;nbsp;NOT&amp;nbsp;IN&amp;nbsp;(&lt;/PRE&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SELECT&amp;nbsp;generated_by&amp;nbsp;FROM&amp;nbsp;wtb_orders&amp;nbsp;where&amp;nbsp;is_paid=-6&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AND&amp;nbsp;created&amp;nbsp;&amp;gt;=&amp;nbsp;DATE_SUB(NOW(),&amp;nbsp;INTERVAL&amp;nbsp;6&amp;nbsp;HOUR&amp;nbsp;) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ORDER&amp;nbsp;BY&amp;nbsp;created&amp;nbsp;DESC&amp;nbsp;LIMIT&amp;nbsp;1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/P&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;That gives this error&lt;/P&gt;&lt;PRE&gt;This version doesn't yet support 'LIMIT &amp;amp; IN/ALL/ANY/SOME subquery&lt;/PRE&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;And if we don't use &amp;nbsp;ORDER&amp;nbsp;BY&amp;nbsp;created&amp;nbsp;DESC&amp;nbsp;LIMIT&amp;nbsp;1, then the renewal system will always try to renew an order because I guess each time the renewal is failing it's always creating a new entry that has an interval that doesn't fit within the rules, but I could be wrong&lt;/P&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;essentially what I want to do is to stop the renewal script from selecting the same order twice within less than 6 hours duration.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 08:22:45 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/This-version-doesn-t-yet-support-LIMIT-amp-IN-ALL-ANY-SOME/m-p/74615#M46408</guid>
      <dc:creator>EthanElijah</dc:creator>
      <dc:date>2021-01-07T08:22:45Z</dc:date>
    </item>
  </channel>
</rss>

