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

Insert multiple row to external database Oracle

Former Member
0 Likes
1,708

Hi all,

i extracted data into ABAP internal table, and now i need to insert this data to external database Oracle.

My database connection is ready (transaction DBCO).

How can i insert multiple rows in one request ?

1 ACCEPTED SOLUTION
Read only

VenkatRamesh_V
Active Contributor
0 Likes
1,437

Hi ERIC,

By using Transaction Code DBCO(Database Connection Maintenance) you can connect the external database.

View the link.

test connection using dbco | SCN

using Native SQL Insert the data's to external table.

View the link.

Hope it helpful,

Regards,

Venkat.

9 REPLIES 9
Read only

VenkatRamesh_V
Active Contributor
0 Likes
1,438

Hi ERIC,

By using Transaction Code DBCO(Database Connection Maintenance) you can connect the external database.

View the link.

test connection using dbco | SCN

using Native SQL Insert the data's to external table.

View the link.

Hope it helpful,

Regards,

Venkat.

Read only

0 Likes
1,437

Hi,

it's kind but it's not my requirement, i know transaction DBCO and native SQL but my question is to know how can i insert multiple rows in an external database.

Regards,

Eric

Read only

0 Likes
1,437

Hi Eric,

loop of the internal table.

Use Native SQL Insert statement .

CATCH the native sql error.

endloop,

Hope it helpful,

Regards,

Venkat.

Read only

0 Likes
1,437

Hi Eric,

please check this Thread.

Regards

Oliver

Read only

0 Likes
1,437

I think you don't understand my requirement...

Read only

0 Likes
1,437

Thanks Oliver, so if i understand well, for my requirement i have to use Open SQL, right ?

Read only

0 Likes
1,437

Hi Eric,

yes, Open SQL can do this. But you Need to create the same table under the same Name in the DEFAULT database Connection using the normal data dictionary. Only then the ABAP can be generated.
I have never tried to run a SQL Command vie external Connection with a table instead of single records but I can see no reason why FROM TABLE shouldn't work.

Regards

Oliver

Read only

0 Likes
1,437

Ok, so i will test it

Just one question, in the definition of the Oracle table i have the following field :

. SPR_DATA varchar(32) NOT NULL


What is the conversion in ABAP ? CHAR32 ?

. DT_DATA date NOT NULL


Same question, in ABAP i have to use type DATUM ?


Regards,

Eric



Read only

0 Likes
1,437

Hi Eric,

varchar(32) is CHAR32. You can compare the technical types using SE11 under "Utilities -> Database Object -> Display".

ABAP stores Dates in text fields using one Byte for each Digit. Oracle uses its own internal format to store dates. Date data is stored in fixed-length fields of seven bytes each, corresponding to century, year, month, day, hour, minute and second.

I think I would try to create a RAW(7) field for this. To populate each Byte with the values as defined by Oracle is something ABAP is not really good in. It will be tricky to find an ABAP field matching this Oracle Definition. Maybe <fieldname>(7) type x ??

Wouldn't it be easier to Change the type in the external table to a character field?

Regards

Oliver