<?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 Select with SQL - retrieve no results in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780359#M1878837</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abapers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are using the following code to retrieve data from an oracle database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We get results but if we add the lines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'AND TO_CHAR(DOCDATE, ''MM'') = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'AND TO_CHAR (DOCDATE, ''YYYY'') = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we get no results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so what are doing wrong in these two lines?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you and best regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="l0s311"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;*-----------------------------------------------------------------------&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s311"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Form&amp;nbsp; le_doc_header&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s311"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Le doc_header&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s311"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;*-----------------------------------------------------------------------&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;FORM &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;le_doc_header &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;USING &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;p_con_ref &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE REF TO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;cl_sql_connection&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;RAISING &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;cx_sql_exception&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;DATA&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;: &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_stmt&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;string&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_stmt_ref&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE REF TO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;cl_sql_statement&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_dref&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE REF TO data&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_sqlerr_ref&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE REF TO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;cx_sql_exception&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_res_ref&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE REF TO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;cl_sql_result_set&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_company&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;descarga&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;company&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_Branch&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;descarga&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Branch&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_NombreDescarga &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;descarga&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;NombreDescarga&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_monat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE c &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;LENGTH &lt;/SPAN&gt;&lt;SPAN class="l0s321"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;2&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_gjahr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE c &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;LENGTH &lt;/SPAN&gt;&lt;SPAN class="l0s321"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;4&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s311"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_wa_monat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPE monat,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s311"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_wa_gjahr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPE gjahr,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_itab&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE STANDARD TABLE OF &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;doc_header&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_row_cnt&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE i&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TRY&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;CONCATENATE &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;bd_name &lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'.CAF_VSW_ERP_DOC_HEADER' &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;c_tabname&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;CONCATENATE &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'select * from' &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;c_tabname&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'where COMPANY = ? AND BRANCH = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'AND NombreDescarga = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'AND TO_CHAR(DOCDATE, ''MM'') = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'AND TO_CHAR (DOCDATE, ''YYYY'') = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_stmt &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;SEPARATED BY &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;space&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_company &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;= &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;empre&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_branch &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;= &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;pardepar&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_NombreDescarga &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;= &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;NombreDescarga&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_monat &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;= &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;monat&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_gjahr &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;= &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;gjahr&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_stmt_ref &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;= &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;p_con_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;create_statement&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;( ).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;GET REFERENCE OF &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_company &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_stmt_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;set_param&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;( &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;GET REFERENCE OF &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_Branch &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_stmt_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;set_param&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;( &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;GET REFERENCE OF &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_NombreDescarga &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_stmt_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;set_param&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;( &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;GET REFERENCE OF &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_monat &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_stmt_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;set_param&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;( &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;GET REFERENCE OF &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_gjahr &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_stmt_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;set_param&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;( &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_res_ref &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;= &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_stmt_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;execute_query&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;( &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_stmt &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;GET REFERENCE OF &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_itab &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;into &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_res_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;set_param_table&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;( &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;MOVE &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_itab[] &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;doc_header[]&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;CATCH &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;cx_sql_exception &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_sqlerr_ref&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_res_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;close&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;( ).&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;ENDTRY&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;ENDFORM&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s311"&gt;" Le doc_header&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Dec 2014 18:55:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-12-18T18:55:42Z</dc:date>
    <item>
      <title>Select with SQL - retrieve no results</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780359#M1878837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abapers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are using the following code to retrieve data from an oracle database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We get results but if we add the lines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'AND TO_CHAR(DOCDATE, ''MM'') = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'AND TO_CHAR (DOCDATE, ''YYYY'') = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we get no results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so what are doing wrong in these two lines?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you and best regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="l0s311"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;*-----------------------------------------------------------------------&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s311"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Form&amp;nbsp; le_doc_header&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s311"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Le doc_header&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s311"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;*-----------------------------------------------------------------------&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;FORM &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;le_doc_header &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;USING &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;p_con_ref &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE REF TO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;cl_sql_connection&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;RAISING &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;cx_sql_exception&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;DATA&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;: &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_stmt&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;string&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_stmt_ref&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE REF TO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;cl_sql_statement&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_dref&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE REF TO data&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_sqlerr_ref&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE REF TO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;cx_sql_exception&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_res_ref&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE REF TO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;cl_sql_result_set&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_company&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;descarga&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;company&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_Branch&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;descarga&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Branch&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_NombreDescarga &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;descarga&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;NombreDescarga&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_monat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE c &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;LENGTH &lt;/SPAN&gt;&lt;SPAN class="l0s321"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;2&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_gjahr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE c &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;LENGTH &lt;/SPAN&gt;&lt;SPAN class="l0s321"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;4&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s311"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_wa_monat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPE monat,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s311"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_wa_gjahr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPE gjahr,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_itab&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE STANDARD TABLE OF &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;doc_header&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_row_cnt&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TYPE i&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TRY&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;CONCATENATE &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;bd_name &lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'.CAF_VSW_ERP_DOC_HEADER' &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;c_tabname&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;CONCATENATE &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'select * from' &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;c_tabname&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'where COMPANY = ? AND BRANCH = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'AND NombreDescarga = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'AND TO_CHAR(DOCDATE, ''MM'') = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'AND TO_CHAR (DOCDATE, ''YYYY'') = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_stmt &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;SEPARATED BY &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;space&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_company &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;= &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;empre&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_branch &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;= &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;pardepar&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_NombreDescarga &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;= &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;NombreDescarga&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_wa_monat &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;= &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;monat&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_gjahr &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;= &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;gjahr&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_stmt_ref &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;= &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;p_con_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;create_statement&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;( ).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;GET REFERENCE OF &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_company &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_stmt_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;set_param&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;( &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;GET REFERENCE OF &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_Branch &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_stmt_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;set_param&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;( &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;GET REFERENCE OF &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_NombreDescarga &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_stmt_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;set_param&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;( &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;GET REFERENCE OF &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_monat &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_stmt_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;set_param&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;( &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;GET REFERENCE OF &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_gjahr &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_stmt_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;set_param&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;( &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_res_ref &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;= &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_stmt_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;execute_query&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;( &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_stmt &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;GET REFERENCE OF &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_itab &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;into &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; l_res_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;set_param_table&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;( &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_dref &lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;MOVE &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_wa_itab[] &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;TO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;doc_header[]&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;CATCH &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;cx_sql_exception &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_sqlerr_ref&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;l_res_ref&lt;/SPAN&gt;&lt;SPAN class="l0s701"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;close&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;( ).&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;ENDTRY&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;ENDFORM&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="l0s311"&gt;" Le doc_header&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2014 18:55:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780359#M1878837</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-12-18T18:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Select with SQL - retrieve no results</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780360#M1878838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What happens if you use single quotes instead of double quotes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2014 19:05:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780360#M1878838</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-12-18T19:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Select with SQL - retrieve no results</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780361#M1878839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;are you supplying month number (eg: 12) and year(2014) for these fields?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;AND TO_CHAR(DOCDATE, ''MM'') = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;'AND TO_CHAR (DOCDATE, ''YYYY'') = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2014 19:07:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780361#M1878839</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-12-18T19:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: Select with SQL - retrieve no results</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780362#M1878840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob:&lt;/P&gt;&lt;P&gt;I am gona try it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Abdul&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes i am supplyng 12 and 2014.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 08:58:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780362#M1878840</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-12-19T08:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Select with SQL - retrieve no results</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780363#M1878841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As suggested, try with single quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt;"&gt;'AND TO_CHAR(DOCDATE, 'MM') = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt;"&gt;'AND TO_CHAR (DOCDATE, 'YYYY') = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 09:18:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780363#M1878841</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2014-12-19T09:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: Select with SQL - retrieve no results</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780364#M1878842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We try wiht single quotes but we get an error.&lt;/P&gt;&lt;P&gt;The statement we get, as we show you with the double quotes are.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from RVDSD.CAF_VSW_ERP_DOC_HEADER where COMPANY = ? AND BRANCH = ? AND NombreDescarga = ? AND TO_CHAR(DOCDATE, 'MM') = ? AND TO_CHAR (DOCDATE, 'YYYY') = ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see we get a single quote when we query the database&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you and best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 09:45:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780364#M1878842</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-12-19T09:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Select with SQL - retrieve no results</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780365#M1878843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/611773" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 09:53:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780365#M1878843</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-12-19T09:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Select with SQL - retrieve no results</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780366#M1878844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Above thre is an image of the error we get&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 09:54:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780366#M1878844</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-12-19T09:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Select with SQL - retrieve no results</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780367#M1878845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what about the below statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt;"&gt;CONCATENATE &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;bd_name &lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt;"&gt;'.CAF_VSW_ERP_DOC_HEADER' &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt;"&gt;INTO &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;c_tabname&lt;/SPAN&gt;&lt;SPAN class="l0s551"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s521"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt;"&gt;CONCATENATE &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt;"&gt;'select * from' &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;c_tabname&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt;"&gt;'where COMPANY = ? AND BRANCH = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt;"&gt;'AND NombreDescarga = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt;"&gt;'AND TO_CHAR(' &lt;STRONG&gt;DOCDATE&lt;/STRONG&gt; ', ''MM'') = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt;"&gt;'AND TO_CHAR (' &lt;STRONG&gt;DOCDATE'&lt;/STRONG&gt;, ''YYYY'') = ?'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt;"&gt;Since the usual syntax for oracle seems to be with to_char(docdate, 'MM') and to_char(docdate, 'YYYY'), we need to check whether docdate can be passed as variable which holds value and rest others in quotes like you had done for c_tabname.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt;"&gt;Double quotes with DOCDATE should be used as variable holding values and quotes should end and start after this.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="l0s331"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt;"&gt;Just give a try. It may help.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 10:24:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780367#M1878845</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2014-12-19T10:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Select with SQL - retrieve no results</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780368#M1878846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joao,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the problem is because &lt;SPAN style="color: #333333;"&gt;DOCDATE is not stored as date in Oracle database. Please note that SAP stores date as character and the format is YYYYMMDD.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So the solution is to change DOCDATE to date and then you can get the month or year portion of it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TO_CHAR&lt;SPAN class="L0S55"&gt;(&lt;/SPAN&gt;TO_DATE&lt;SPAN class="L0S55"&gt;(&lt;/SPAN&gt;begda&lt;SPAN class="L0S55"&gt;, &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'&lt;/SPAN&gt;YYYYMMDD&lt;SPAN class="L0S33"&gt;'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;, &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'&lt;/SPAN&gt;YYYY&lt;SPAN class="L0S33"&gt;'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To give you an example, please find it following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;INFOTYPES&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;&lt;SPAN class="L0S32"&gt;0105&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;DATA&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;p_con_ref &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;REF &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TO &lt;/SPAN&gt;cl_sql_connection&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;DATA&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;l_stmt&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;string&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; l_stmt_ref&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;REF &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TO &lt;/SPAN&gt;cl_sql_statement&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; l_dref&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;REF &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TO &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;data&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; l_sqlerr_ref&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;REF &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TO &lt;/SPAN&gt;cx_sql_exception&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; l_res_ref&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;REF &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TO &lt;/SPAN&gt;cl_sql_result_set&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; lv_param1 &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;c &lt;/SPAN&gt;LENGTH &lt;SPAN class="L0S32"&gt;30&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; lv_param2 &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;c &lt;/SPAN&gt;LENGTH &lt;SPAN class="L0S32"&gt;10&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; lt_result &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;STANDARD &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;OF &lt;/SPAN&gt;pa0105&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; lwa_result &lt;SPAN class="L0S52"&gt;LIKE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;LINE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;OF &lt;/SPAN&gt;lt_result&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;TRY&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CREATE &lt;/SPAN&gt;OBJECT p_con_ref&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CONCATENATE &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'select * from pa0105 '&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S33"&gt;' where usrid_long = ? '&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S33"&gt;' AND usrty = '&lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'0010'&lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;' '&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S33"&gt;' AND&amp;nbsp; TO_CHAR(TO_DATE(begda, '&lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'YYYYMMDD'&lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'), '&lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'YYYY'&lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;') = ? ' &lt;/SPAN&gt;&lt;SPAN class="L0S31"&gt;"Please note you need to put two single apostrophe instead of double apostrophe &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;l_stmt &lt;SPAN class="L0S52"&gt;SEPARATED &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;BY &lt;/SPAN&gt;space&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_stmt_ref &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;p_con_ref&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;create_statement&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_param1 &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;&lt;A class="jive-link-email-small" href="mailto:'YOUREMAIL@YOURCOMPANY.COM.AU"&gt;'YOUREMAIL@YOURCOMPANY.COM.AU&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;GET &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;REFERENCE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;OF &lt;/SPAN&gt;lv_param1 &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;l_dref&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_stmt_ref&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;set_param&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;l_dref &lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_param2 &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'2009'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;GET &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;REFERENCE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;OF &lt;/SPAN&gt;lv_param2 &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;l_dref&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_stmt_ref&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;set_param&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;l_dref &lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_res_ref &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;l_stmt_ref&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;execute_query&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;l_stmt &lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;GET &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;REFERENCE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;OF &lt;/SPAN&gt;lt_result &lt;SPAN class="L0S52"&gt;into &lt;/SPAN&gt;l_dref&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_res_ref&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;set_param_table&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;l_dref &lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;l_res_ref&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;next_package&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;) &lt;/SPAN&gt;&amp;gt; &lt;SPAN class="L0S32"&gt;0 &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;LOOP &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;AT &lt;/SPAN&gt;lt_result &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;lwa_result&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;WRITE&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;:&lt;/SPAN&gt;/ lwa_result&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;usrid_long&lt;SPAN class="L0S55"&gt;, &lt;/SPAN&gt;lwa_result&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;begda&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDLOOP&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CATCH &lt;/SPAN&gt;cx_sql_exception &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;l_sqlerr_ref&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;ENDTRY&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;Hopefully this will resolve your issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;Additionally, you can use SQL command editor in DB02 transaction to test if your native sql can be executed properly or not.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;Stevanic&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Dec 2014 01:54:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-sql-retrieve-no-results/m-p/10780368#M1878846</guid>
      <dc:creator>ec1</dc:creator>
      <dc:date>2014-12-23T01:54:46Z</dc:date>
    </item>
  </channel>
</rss>

