<?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 Eclipse ABAP SQL console not always uses SQL binding parameters in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/eclipse-abap-sql-console-not-always-uses-sql-binding-parameters/m-p/12059182#M1969233</link>
    <description>&lt;P&gt;When I was testing ABAP CDS views in Eclipse ABAP SQL console, I noticed that when I changed the value of a WHERE clause parameter, the query was the first time slow and the second time fast. &lt;BR /&gt;The cause is that after the value is changed, a new Execution Plan is compiled.&lt;BR /&gt;The cause of that, is because the WHERE clause parameter is not always transferred to HANA as a binding parameter but as a literal parameter. In other cases is does generate a binding parameter and there is no new Execution Plan compiled.&lt;/P&gt;
  &lt;P&gt;I created a simple query on VBAP to show the problem. &lt;BR /&gt;And below that query the query of the Plan cache is shown. &lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;1. Only parameter VBELN is transferred and it is transferred as literial parameter. &lt;/STRONG&gt;&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;SELECT * FROM VBAP WHERE VBELN = '0000004900' &lt;/CODE&gt;&lt;/PRE&gt; 
  &lt;PRE&gt;&lt;CODE&gt;SELECT /* FDA READ */ * FROM "VBAP" WHERE "MANDT" = ? AND "VBELN" = N'0000004900' LIMIT 100 &lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;STRONG&gt;2. Parameter VBELN and POSNR are transferred and VBELN is transferred as literal and POSNR as binding variable. &lt;/STRONG&gt;&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;SELECT * FROM VBAP WHERE VBELN = '0000004900' AND POSNR = '000010' &lt;/CODE&gt;&lt;/PRE&gt; 
  &lt;PRE&gt;&lt;CODE&gt;SELECT /* FDA READ */ * FROM "VBAP" WHERE "MANDT" = ? AND "VBELN" = N'0000004900' AND "POSNR" = ? LIMIT 100 &lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;STRONG&gt;3. Now only POSNR is used, and it is transferred as binding parameter. &lt;/STRONG&gt;&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;SELECT * FROM VBAP WHERE POSNR = '000010' &lt;/CODE&gt;&lt;/PRE&gt; 
  &lt;PRE&gt;&lt;CODE&gt;SELECT /* FDA READ */ * FROM "VBAP" WHERE "MANDT" = ? AND "POSNR" = ? LIMIT 100 &lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;VBELN is a CHAR field. POSNR is a NUMC field. Maybe that's the cause.&lt;/P&gt;
  &lt;P&gt;Is there a way to force that VBELN is also transferred as binding parameter?&lt;/P&gt;</description>
    <pubDate>Sat, 12 Oct 2019 10:15:30 GMT</pubDate>
    <dc:creator>AlwinPut</dc:creator>
    <dc:date>2019-10-12T10:15:30Z</dc:date>
    <item>
      <title>Eclipse ABAP SQL console not always uses SQL binding parameters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/eclipse-abap-sql-console-not-always-uses-sql-binding-parameters/m-p/12059182#M1969233</link>
      <description>&lt;P&gt;When I was testing ABAP CDS views in Eclipse ABAP SQL console, I noticed that when I changed the value of a WHERE clause parameter, the query was the first time slow and the second time fast. &lt;BR /&gt;The cause is that after the value is changed, a new Execution Plan is compiled.&lt;BR /&gt;The cause of that, is because the WHERE clause parameter is not always transferred to HANA as a binding parameter but as a literal parameter. In other cases is does generate a binding parameter and there is no new Execution Plan compiled.&lt;/P&gt;
  &lt;P&gt;I created a simple query on VBAP to show the problem. &lt;BR /&gt;And below that query the query of the Plan cache is shown. &lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;1. Only parameter VBELN is transferred and it is transferred as literial parameter. &lt;/STRONG&gt;&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;SELECT * FROM VBAP WHERE VBELN = '0000004900' &lt;/CODE&gt;&lt;/PRE&gt; 
  &lt;PRE&gt;&lt;CODE&gt;SELECT /* FDA READ */ * FROM "VBAP" WHERE "MANDT" = ? AND "VBELN" = N'0000004900' LIMIT 100 &lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;STRONG&gt;2. Parameter VBELN and POSNR are transferred and VBELN is transferred as literal and POSNR as binding variable. &lt;/STRONG&gt;&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;SELECT * FROM VBAP WHERE VBELN = '0000004900' AND POSNR = '000010' &lt;/CODE&gt;&lt;/PRE&gt; 
  &lt;PRE&gt;&lt;CODE&gt;SELECT /* FDA READ */ * FROM "VBAP" WHERE "MANDT" = ? AND "VBELN" = N'0000004900' AND "POSNR" = ? LIMIT 100 &lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;STRONG&gt;3. Now only POSNR is used, and it is transferred as binding parameter. &lt;/STRONG&gt;&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;SELECT * FROM VBAP WHERE POSNR = '000010' &lt;/CODE&gt;&lt;/PRE&gt; 
  &lt;PRE&gt;&lt;CODE&gt;SELECT /* FDA READ */ * FROM "VBAP" WHERE "MANDT" = ? AND "POSNR" = ? LIMIT 100 &lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;VBELN is a CHAR field. POSNR is a NUMC field. Maybe that's the cause.&lt;/P&gt;
  &lt;P&gt;Is there a way to force that VBELN is also transferred as binding parameter?&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2019 10:15:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/eclipse-abap-sql-console-not-always-uses-sql-binding-parameters/m-p/12059182#M1969233</guid>
      <dc:creator>AlwinPut</dc:creator>
      <dc:date>2019-10-12T10:15:30Z</dc:date>
    </item>
  </channel>
</rss>

