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

Best solution for EXEC SQLu2026. INSERT? Time problem

Former Member
0 Likes
369

Hi:

I have a problem with native sql in abap. I have next code and itu2019s working properly (see below) , but the problem occurs when abap internal table is too big, because exec sql u2026 endexec is executed one time for each internal table line, so it needs too much time.

Do you know any solution? Is it possible to insert the internal table with only one exec sql?

Thanku2019s in advance for your time.

LOOP AT i_table.

EXEC SQL.

insert into oracle_table@db

(value1,

Value2

)

values

(:i_table-val1,

:i_table-val2

)

ENDEXEC.

ENDLOOP.

1 ACCEPTED SOLUTION
Read only

former_member273995
Participant
0 Likes
334

Definately this approach will take a lot of time.

i would suggest that you create a table, fill that table with the internal table you are using for the insertion and use below mentioned code this will improve your processing time.

Exec SQL.

INSERT INTO

EXEC SQL.

insert into oracle_table@db

(value1,

Value2

)

SELECT COLUMN1, COLUMN2 FROM DUAL

FROM ZTABLE

ENDEXEC.

1 REPLY 1
Read only

former_member273995
Participant
0 Likes
335

Definately this approach will take a lot of time.

i would suggest that you create a table, fill that table with the internal table you are using for the insertion and use below mentioned code this will improve your processing time.

Exec SQL.

INSERT INTO

EXEC SQL.

insert into oracle_table@db

(value1,

Value2

)

SELECT COLUMN1, COLUMN2 FROM DUAL

FROM ZTABLE

ENDEXEC.