‎2015 Nov 09 4:22 PM
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 ?
‎2015 Nov 09 4:33 PM
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.
‎2015 Nov 09 4:33 PM
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.
‎2015 Nov 09 4:41 PM
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
‎2015 Nov 09 4:49 PM
Hi Eric,
loop of the internal table.
Use Native SQL Insert statement .
CATCH the native sql error.
endloop,
Hope it helpful,
Regards,
Venkat.
‎2015 Nov 09 4:49 PM
‎2015 Nov 09 4:51 PM
‎2015 Nov 09 4:52 PM
Thanks Oliver, so if i understand well, for my requirement i have to use Open SQL, right ?
‎2015 Nov 09 5:02 PM
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
‎2015 Nov 09 5:08 PM
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
‎2015 Nov 09 5:38 PM
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