<?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 Re: About Native SQL Insert statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-native-sql-insert-statement/m-p/1906557#M377818</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Open SQL allows you to access database tables declared in the ABAP Dictionary, regardless of the database platform you are using. Native SQL allows you to use database-specific SQL statements in an ABAP program. This means that you can use database tables that are not managed by the ABAP Dictionary, and therefore integrate data that is not part of the SAP Web AS ABAP System.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use a Native SQL statement, you must precede it with the EXEC SQL statement, and follow it with the ENDEXEC statement as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC SQL [PERFORMING form].&lt;/P&gt;&lt;P&gt;  Native SQL statement&lt;/P&gt;&lt;P&gt;ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no period (.) after Native SQL statements. Furthermore, using inverted commas (&amp;#147;) in a Native SQL statement or an asterisk (*) at the beginning of a line does not introduce a comment as it would in normal ABAP syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Native SQL statements, the data is transported between the database table and the ABAP program using host variables. These variables are declared in the ABAP program, and preceded in the Native SQL statement by a colon (:). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT demo_native_sql.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF wa,&lt;/P&gt;&lt;P&gt;        connid   TYPE spfli-connid,&lt;/P&gt;&lt;P&gt;        cityfrom TYPE spfli-cityfrom,&lt;/P&gt;&lt;P&gt;        cityto   TYPE spfli-cityto,&lt;/P&gt;&lt;P&gt;      END OF wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA c1 TYPE spfli-carrid VALUE 'LH'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC SQL PERFORMING loop_output.&lt;/P&gt;&lt;P&gt;  SELECT connid, cityfrom, cityto&lt;/P&gt;&lt;P&gt;  INTO   :wa&lt;/P&gt;&lt;P&gt;  FROM   spfli&lt;/P&gt;&lt;P&gt;  WHERE  carrid = :c1&lt;/P&gt;&lt;P&gt;ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM loop_output.&lt;/P&gt;&lt;P&gt;  WRITE: / wa-connid, wa-cityfrom, wa-cityto.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The work area wa and the field c1 Native SQL statement SELECT are used. wa is the target area into which the selected data is written. As a structure, wa is handled in the INTO clause as if all subfields were listed individually: [..] INTO :wa-connid, :wa-cityfrom, :wa-cityto. c1 is used in the WHERE clause. The subroutine loop_output writes the data from wa to the list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sruthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Feb 2007 13:04:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-14T13:04:31Z</dc:date>
    <item>
      <title>About Native SQL Insert statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-native-sql-insert-statement/m-p/1906554#M377815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;INSERT INTO ZPO_BULKOR_ORDER&lt;/P&gt;&lt;P&gt;          (ORDER_NUMBER, SEQUENCE_NUMBER)&lt;/P&gt;&lt;P&gt;          VALUES ('45679012', '12345987')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          COMMIT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why is this not working and giving a dump ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone please explain this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manoj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 06:47:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-native-sql-insert-statement/m-p/1906554#M377815</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T06:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: About Native SQL Insert statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-native-sql-insert-statement/m-p/1906555#M377816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;Could you post your entire code?&lt;/P&gt;&lt;P&gt;Have you given the stmt inside EXEC SQL....and ENDEXEC?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Subramanian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 06:56:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-native-sql-insert-statement/m-p/1906555#M377816</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T06:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: About Native SQL Insert statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-native-sql-insert-statement/m-p/1906556#M377817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Native SQL statement is to be included between EXEC SQL and ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC SQL.&lt;/P&gt;&lt;P&gt;  &amp;lt;Native SQL statement&amp;gt;&lt;/P&gt;&lt;P&gt;ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also in the INSERT statement you need not mention the field names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 06:57:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-native-sql-insert-statement/m-p/1906556#M377817</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T06:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: About Native SQL Insert statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-native-sql-insert-statement/m-p/1906557#M377818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Open SQL allows you to access database tables declared in the ABAP Dictionary, regardless of the database platform you are using. Native SQL allows you to use database-specific SQL statements in an ABAP program. This means that you can use database tables that are not managed by the ABAP Dictionary, and therefore integrate data that is not part of the SAP Web AS ABAP System.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use a Native SQL statement, you must precede it with the EXEC SQL statement, and follow it with the ENDEXEC statement as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC SQL [PERFORMING form].&lt;/P&gt;&lt;P&gt;  Native SQL statement&lt;/P&gt;&lt;P&gt;ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no period (.) after Native SQL statements. Furthermore, using inverted commas (&amp;#147;) in a Native SQL statement or an asterisk (*) at the beginning of a line does not introduce a comment as it would in normal ABAP syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Native SQL statements, the data is transported between the database table and the ABAP program using host variables. These variables are declared in the ABAP program, and preceded in the Native SQL statement by a colon (:). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT demo_native_sql.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF wa,&lt;/P&gt;&lt;P&gt;        connid   TYPE spfli-connid,&lt;/P&gt;&lt;P&gt;        cityfrom TYPE spfli-cityfrom,&lt;/P&gt;&lt;P&gt;        cityto   TYPE spfli-cityto,&lt;/P&gt;&lt;P&gt;      END OF wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA c1 TYPE spfli-carrid VALUE 'LH'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC SQL PERFORMING loop_output.&lt;/P&gt;&lt;P&gt;  SELECT connid, cityfrom, cityto&lt;/P&gt;&lt;P&gt;  INTO   :wa&lt;/P&gt;&lt;P&gt;  FROM   spfli&lt;/P&gt;&lt;P&gt;  WHERE  carrid = :c1&lt;/P&gt;&lt;P&gt;ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM loop_output.&lt;/P&gt;&lt;P&gt;  WRITE: / wa-connid, wa-cityfrom, wa-cityto.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The work area wa and the field c1 Native SQL statement SELECT are used. wa is the target area into which the selected data is written. As a structure, wa is handled in the INTO clause as if all subfields were listed individually: [..] INTO :wa-connid, :wa-cityfrom, :wa-cityto. c1 is used in the WHERE clause. The subroutine loop_output writes the data from wa to the list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sruthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 13:04:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-native-sql-insert-statement/m-p/1906557#M377818</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T13:04:31Z</dc:date>
    </item>
  </channel>
</rss>

