tags:

views:

44

answers:

1

I might be lazy to search this, but I have no idea how to insert an array of records in to an Oracle table using C# and ODP.Net. I have seen basic examples with inserting primitive types but never found any with something like array of records. Any help?

I basically need to have a record type which would have three out of five columns in a table. Then I need to insert an array of values into the table using C# and ODP.Net.

+1  A: 

there are a few ways to do it, you can create a User Defined Type (udt) and a collection of that type and insert it, or you can pass in assoc. arrays (an array per column if you will) to do the insert. I have answered similar questions

for the udt insert http://stackoverflow.com/questions/3150137/converting-oracle-query-into-user-defined-types-in-pl-sql/3152885#3152885

for the assoc. array insert: http://forums.oracle.com/forums/thread.jspa?messageID=4370850&#4370850

but a nice treat is you already have some examples installed %ORA_HOME%\odp.net\samples\2.x\UDT

(there are other examples for the assoc. array and other odp type things)

let me know if this helps

tanging