<?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: SQL in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql/m-p/3876283#M931763</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;Open SQL allows you to access database tables declared in the ABAP Dictionary regardless of the database platform that you R/3 System is 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 administered by the ABAP Dictionary, and therefore integrate data that is not part of the R/3 System.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a rule, an ABAP program containing database-specific SQL statements will not run under different database systems. If your program will be used on more than one database platform, only use Open SQL statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for more info refer to this link&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3b8b358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3b8b358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 May 2008 07:58:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-15T07:58:19Z</dc:date>
    <item>
      <title>SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql/m-p/3876282#M931762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is meant that Exec SQL .....End SQL?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is used for it??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reply me soon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx,&lt;/P&gt;&lt;P&gt;S.Suresh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 07:54:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql/m-p/3876282#M931762</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T07:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql/m-p/3876283#M931763</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;Open SQL allows you to access database tables declared in the ABAP Dictionary regardless of the database platform that you R/3 System is 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 administered by the ABAP Dictionary, and therefore integrate data that is not part of the R/3 System.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a rule, an ABAP program containing database-specific SQL statements will not run under different database systems. If your program will be used on more than one database platform, only use Open SQL statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for more info refer to this link&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3b8b358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3b8b358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 07:58:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql/m-p/3876283#M931763</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T07:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql/m-p/3876284#M931764</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;&lt;/P&gt;&lt;P&gt;EXEC SQL is a statement used to perform NATIVE SQL operations. &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 &amp;lt;form&amp;gt;.&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;In Native SQL statements, the data is transported between the database table and the ABAP program using host variables. These are declared in the ABAP program, and preceded in the Native SQL statement by a colon (:). You can use elementary structures as host variables. Exceptionally, structures in an INTO clause are treated as though all of their fields were listed individually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the selection in a Native SQL SELECT statement is a table, you can pass it to ABAP line by line using the PERFORMING addition. The program calls a subroutine &amp;lt;form&amp;gt; for each line read. You can process the data further within the subroutine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC SQL PERFORMING subr. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;ENDEXEC. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These statements define an area in an ABAP program in which one or more Native SQL statements are to be carried out. The area between EXEC and ENDEXEC is not completely checked by the syntax check. The statements entered there are passed to the Native SQL interface and processed there as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Almost all SQL statements that are valid for the addressed database system can be included between EXEC and ENDEXEC, in particular the DDL statements. These SQL statements are passed from the Native SQL interface to the database system largely unchanged. The syntax rules are specified by the database system, in particular the case sensitivity rules for database objects. If the syntax allows a separator character between individual statements, you can include several Native SQL statements between EXEC and ENDEXEC. Generally, the semicolon (&lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt; is used as the separator character. &lt;/P&gt;&lt;P&gt;You can also include SAP-specific Native SQL language elements between EXEC and ENDEXEC. These statements are not passed directly from the Native SQL interface to the database, but are converted appropriately. These SAP-specific language elements are:: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Host variables &lt;/P&gt;&lt;P&gt;Statements for cursor processing &lt;/P&gt;&lt;P&gt;Database procedure calls &lt;/P&gt;&lt;P&gt;Statements for establishing database connections &lt;/P&gt;&lt;P&gt;All Native SQL statements bypass SAP buffering. Automatic client handling is not performed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System fields &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The statement ENDEXEC sets the system fields sy-subrc and sy-dbcnt. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sy-subrc Meaning &lt;/P&gt;&lt;P&gt;0 The statements between EXEC and ENDEXEC were executed successfully. &lt;/P&gt;&lt;P&gt;4 The statements between EXEC and ENDEXEC were not executed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ENDEXEC statement sets sy-dbcnt to the number of table rows processed in the last Native SQL statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Programs with Native SQL statements are generally dependent on the database system used, so that they cannot be executed in all SAP Systems. This is especially true for the examples in this section, which was written for Informix database systems. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example Inserting two rows in the database table SCARR. If neither of these rows exists, sy-subrc is set to 0 by ENDEXEC and sy-dbcnt to 1. Otherwise, an exception is raised and handled. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: exc_ref TYPE REF TO cx_sy_native_sql_error, &lt;/P&gt;&lt;P&gt;error_text TYPE string. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRY. &lt;/P&gt;&lt;P&gt;EXEC SQL. &lt;/P&gt;&lt;P&gt;INSERT INTO scarr &lt;/P&gt;&lt;P&gt;(MANDT, CARRID, CARRNAME, CURRCODE, URL) &lt;/P&gt;&lt;P&gt;VALUES ('000', 'FF', 'Funny Flyers', 'EUR', &lt;/P&gt;&lt;P&gt;'http://www.ff.com'); &lt;/P&gt;&lt;P&gt;INSERT INTO scarr &lt;/P&gt;&lt;P&gt;(MANDT, CARRID, CARRNAME, CURRCODE, URL) &lt;/P&gt;&lt;P&gt;VALUES ('000', 'EF', 'Easy Flyers', 'EUR', &lt;/P&gt;&lt;P&gt;'http://www.ef.com'); &lt;/P&gt;&lt;P&gt;ENDEXEC. &lt;/P&gt;&lt;P&gt;CATCH cx_sy_native_sql_error INTO exc_ref. &lt;/P&gt;&lt;P&gt;error_text = exc_ref-&amp;gt;get_text( ). &lt;/P&gt;&lt;P&gt;MESSAGE error_text TYPE 'I'. &lt;/P&gt;&lt;P&gt;ENDTRY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if usefull&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;Raj.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 08:01:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql/m-p/3876284#M931764</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T08:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql/m-p/3876285#M931765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check out&lt;/P&gt;&lt;P&gt;EXEC&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/exec.htm" target="test_blank"&gt;http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/exec.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDEXEC&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/endexec.htm" target="test_blank"&gt;http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/endexec.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 08:05:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql/m-p/3876285#M931765</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T08:05:14Z</dc:date>
    </item>
  </channel>
</rss>

