<?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>Question Re: ADBC Statement not working like similar Native SQL in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/adbc-statement-not-working-like-similar-native-sql/qaa-p/12649487#M4745435</link>
    <description>&lt;P&gt;Look at report ADBC_DEMO (also execute it)&lt;/P&gt;</description>
    <pubDate>Wed, 08 Feb 2023 12:30:51 GMT</pubDate>
    <dc:creator>RaymondGiuseppi</dc:creator>
    <dc:date>2023-02-08T12:30:51Z</dc:date>
    <item>
      <title>ADBC Statement not working like similar Native SQL</title>
      <link>https://community.sap.com/t5/technology-q-a/adbc-statement-not-working-like-similar-native-sql/qaq-p/12649486</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;
  &lt;P&gt;currently I am trying to switch from static Native SQl to dynamic one with ADBC. &lt;/P&gt;
  &lt;P&gt;When I try to execute the same SELECT Statement with cl_sql_statement_&amp;gt;execute_query I receive &lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;"Error: Ressource unavailable"&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;That was the old code: &lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;  
CONSTANTS: c_con_name         TYPE dbcon_name VALUE 'SAP2PWS'. "Defined in DBCO
EXEC SQL.
    connect TO :c_con_name
  ENDEXEC.

 EXEC SQL .
      OPEN dbcur FOR SELECT
         PERSID,
         PERSNR,
            FROM TEST_DB0T.TS$$004.VEPSS_SAP_MIA
    ENDEXEC.&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Statement is working, Result set looks fine.&lt;/P&gt;
  &lt;P&gt;Now with the dynamic SQL, i am receiving above named Error:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;    TRY.
    DATA(conn) = cl_sql_connection=&amp;gt;get_connection( c_con_name ).
    DATA(query) = NEW cl_sql_statement( )-&amp;gt;execute_query(
      EXPORTING
        statement   = 'SELECT * FROM TEST_DB0T.TS$$004.VEPSS_SAP_MIA' 
    ).
    CATCH cx_sql_exception     "
          cx_parameter_invalid "
          INTO DATA(error).
          MESSAGE error-&amp;gt;get_text( ) TYPE 'E'.
    ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Has anyone got a clue how to resolve this?&lt;/P&gt;
  &lt;P&gt;Database to connect is DB2 (IBM).&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2135805-error-msg-db-select.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 10:10:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/adbc-statement-not-working-like-similar-native-sql/qaq-p/12649486</guid>
      <dc:creator>casualCoder</dc:creator>
      <dc:date>2023-02-08T10:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: ADBC Statement not working like similar Native SQL</title>
      <link>https://community.sap.com/t5/technology-q-a/adbc-statement-not-working-like-similar-native-sql/qaa-p/12649487#M4745435</link>
      <description>&lt;P&gt;Look at report ADBC_DEMO (also execute it)&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 12:30:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/adbc-statement-not-working-like-similar-native-sql/qaa-p/12649487#M4745435</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2023-02-08T12:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: ADBC Statement not working like similar Native SQL</title>
      <link>https://community.sap.com/t5/technology-q-a/adbc-statement-not-working-like-similar-native-sql/qaa-p/12649488#M4745436</link>
      <description>&lt;P&gt;Hi, I know this Report already, but it doesn't help me though. Am I missing something? In my opinion the Statement has a correct Syntax, it seems like Conflict with the given View Name Construction&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 12:38:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/adbc-statement-not-working-like-similar-native-sql/qaa-p/12649488#M4745436</guid>
      <dc:creator>casualCoder</dc:creator>
      <dc:date>2023-02-08T12:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: ADBC Statement not working like similar Native SQL</title>
      <link>https://community.sap.com/t5/technology-q-a/adbc-statement-not-working-like-similar-native-sql/qaa-p/12649489#M4745437</link>
      <description>&lt;P&gt;The reason code&lt;A href="https://www.ibm.com/docs/en/db2-for-zos/12?topic=codes-00d31020"&gt; 00D31020&lt;/A&gt; would be &lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;An attempt was made to use SNA/APPC communications to create an outbound DRDA protocol connection. However, this DDF, as identified by the corresponding resource-type of 00001000 and its Db2 subsystem ID as the corresponding resource-name, was started with an IPNAME value. This process caused DDF to only start its TCP/IP communications support.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The type of resource 00001000 is &lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;DDF 'LOCATION or SUBSYSTEM ID'&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 08 Feb 2023 14:00:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/adbc-statement-not-working-like-similar-native-sql/qaa-p/12649489#M4745437</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2023-02-08T14:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: ADBC Statement not working like similar Native SQL</title>
      <link>https://community.sap.com/t5/technology-q-a/adbc-statement-not-working-like-similar-native-sql/qaa-p/12649490#M4745438</link>
      <description>&lt;P&gt;Hi, found the Solution by myself. &lt;/P&gt;&lt;P&gt;I forgot to pass the Connection Object to the Statement, without that it generates a new Connection which is not the intended one. &lt;/P&gt;&lt;P&gt;After the call I then have to bind a workarea to access the Result Set:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TRY.
        DATA(conn) = cl_sql_connection=&amp;gt;get_connection( c_con_name ).
        DATA(result_set) = NEW cl_sql_statement( con_ref = conn )-&amp;gt;execute_query(
          EXPORTING
            hold_cursor = 'X'
            statement   = | SELECT | &amp;amp;&amp;amp;
                          | PERSID, PERSNR, GVON | &amp;amp;&amp;amp;
                          | FROM X-X-X |
        ).
        result_set-&amp;gt;set_param_struct( struct_ref = REF #( wa_pws ) )." Referenz auf Ausgabevariable
        WHILE result_set-&amp;gt;next( ) &amp;gt; 0.
            "Do sth
        ENDWHILE.
        conn-&amp;gt;close( ).
      CATCH cx_sql_exception     " Ausnahmeklasse für SQL Fehler
            cx_parameter_invalid " Oberklasse für Parameterfehler
        INTO DATA(error).
        MESSAGE error-&amp;gt;get_text( ) TYPE 'E'.
    ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Feb 2023 06:54:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/adbc-statement-not-working-like-similar-native-sql/qaa-p/12649490#M4745438</guid>
      <dc:creator>casualCoder</dc:creator>
      <dc:date>2023-02-09T06:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: ADBC Statement not working like similar Native SQL</title>
      <link>https://community.sap.com/t5/technology-q-a/adbc-statement-not-working-like-similar-native-sql/qaa-p/12649491#M4745439</link>
      <description>&lt;P&gt;Didn't ADBC_DEMO program help you to see that your query worked, so it meant that it was your code which was faulty? (also debugging ADBC_DEMO to see the differences between ADBC executed by ADBC_DEMO and by your program)&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 08:49:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/adbc-statement-not-working-like-similar-native-sql/qaa-p/12649491#M4745439</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-02-09T08:49:40Z</dc:date>
    </item>
  </channel>
</rss>

