Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SQL From External Oracle DB using ADBC

Hi All,

We currently have a program that connects to an external Oracle database using native SQL as shown below.

This program works perfectly, however we now want to us ADBC to connect to external Oracle DBs and we have decided to use this program as our pilot program.

I was just wondering has anyone here used ADBC to connect to an external Oracle database and what the code would be to convert the below code to use ADBC.

Many thanks for any help provided,

Points awarded,

Colm

*data decleration
DATA: f1(30),
        f2(30),
        f3(1) VALUE  '7',
        f5(1) VALUE IS INITIAL,
        f4 TYPE zpodcounter-contr.

* Connect to DB
    EXEC SQL.
      connect to '*DBNameFromDBCONTable'
    ENDEXEC.

    IF sy-subrc <> 0.
      MESSAGE w000(z2) WITH 'Could not connect to Oracle '.
    ENDIF.

*Read from DB
    EXEC SQL PERFORMING STORETOTABLE.
      SELECT F_DOCNUMBER, A38 INTO :F1, :F2 FROM doctaba
             WHERE F_DOCCLASSNUMBER = :F3
             AND F_DOCNUMBER > :F4
             AND A38 <> :F5
    ENDEXEC.

Message was edited by:

Colm Gavin - blanking out database names for security

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question