Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What’s the best way to do bulk insert in oracle?

Status
Not open for further replies.

BJoy

Programmer
Feb 15, 2019
4
GB
Hi,
What is the best way to do bulk insert from c# UI into Oracle database. I tried it passing XML string into oracle (see the below code) but xmltype doesn't accept more than 4000 characters.

PROCEDURE UDPATE_NEIGHBOUR_BY_EXTENT(P_XML IN CLOB) AS
v_today date :=SYSDATE;
BEGIN
FOR item IN (
SELECT xt.* FROM XMLTABLE('/neighbours/row'
PASSING XMLTYPE(P_XML)
COLUMNS
PA_REFERENCE NUMBER(12) PATH 'reference',
ADDRESSABLE_OBJECT_CODE VARCHAR2(12) PATH 'addressableobjectcode',
CREATE_BY VARCHAR2(25) PATH 'createdby',
ADDRESS_TEXT VARCHAR2(2000) PATH 'addresstext',
NON_POSTAL_ADDRESS CHAR(1) PATH 'nonpostaladdress'
)xt)
LOOP

INSERT INTO PA_NEIGHBOUR(PA_REFERENCE, ADDRESSABLE_OBJECT_CODE, EFFECT_DATE, CREATE_DATE, CREATE_BY, ADDRESS_TEXT, NON_POSTAL_ADDRESS)
VALUES( item.PA_REFERENCE, item.ADDRESSABLE_OBJECT_CODE, v_today, v_today, item.CREATE_BY, item.ADDRESS_TEXT, item.NON_POSTAL_ADDRESS);
END LOOP;
END UDPATE_NEIGHBOUR_BY_EXTENT;

so, What’s the best way to do bulk insert in oracle?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top