Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Native SQL for Abap connection with Oracle

Former Member
0 Likes
942

Hi Abap developers,

We need to connect SAP with an external Oracle database. We will need to read and to write Oracle database.

We create a simple report only to make some tests. The source code is the following. It is working fine.

But my question is where can i find a complete documentation about this Native SQL and samples with code about theses issues.

If  you want purpose another way to connect the databases you will be welcome too.

Than you and best regards

      JFernandes

*&---------------------------------------------------------------------*

*& Report  ZTESTE_LIG

*&

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

REPORT  ZTESTE_LIG.

DATA: CONNECTION LIKE DBCON-CON_NAME VALUE 'VSALES'.

  data: canal like VBRK-VTWEG.

  data: begin of itab occurs 100,

    aca_codemp type i,

    aca_coddel type i,

    end of itab.

   EXEC SQL.

     CONNECT TO :CONNECTION

   ENDEXEC.

   IF SY-SUBRC = 0.

     EXEC SQL.

       SET CONNECTION :CONNECTION

     ENDEXEC.

refresh itab.

EXEC SQL.

   SELECT ACA_CODEMP, ACA_CODDEL

          INTO :ITAB

          FROM

          ZZ_ARTCANAL

ENDEXEC.

append itab.

loop at itab.

   write: itab-aca_codemp, itab-aca_coddel.

endloop.

     EXEC SQL.

       SET CONNECTION DEFAULT

     ENDEXEC.

     EXEC SQL.

       DISCONNECT :CONNECTION

     ENDEXEc.

   ENDIF.

1 ACCEPTED SOLUTION
Read only

ThomasZloch
Active Contributor
0 Likes
571

You would probably need to look around on Oracle's web site to find such documentation of their SQL dialect.

Let me suggest you also check out ABAP database connectivity (ADBC) for this purpose, allowing to access external databases in an OO fashion:

http://help.sap.com/abapdocu_740/en/abenadbc.htm

Thomas

1 REPLY 1
Read only

ThomasZloch
Active Contributor
0 Likes
572

You would probably need to look around on Oracle's web site to find such documentation of their SQL dialect.

Let me suggest you also check out ABAP database connectivity (ADBC) for this purpose, allowing to access external databases in an OO fashion:

http://help.sap.com/abapdocu_740/en/abenadbc.htm

Thomas