Application Development 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: 

SQL From External Oracle DB using ADBC

Former Member
0 Kudos
173

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

1 REPLY 1

Former Member
0 Kudos
82

I resolved this issue myself. For the answer please message me.