使用 ODP.Net 在 Oracle 表中插入记录数组
我可能懒于搜索这个,但我不知道如何使用 C# 和 ODP.Net 将记录数组插入到 Oracle 表中。我见过插入基本类型的基本示例,但从未发现任何类似记录数组的示例。有什么帮助吗?
我基本上需要一个记录类型,该类型在表中包含五列中的三列。然后我需要使用 C# 和 ODP.Net 将一组值插入到表中。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有几种方法可以做到这一点,您可以创建一个用户定义类型(udt)和该类型的集合并插入它,或者您可以传入 assoc。数组(如果愿意的话,每列一个数组)来执行插入。我已经回答了
有关 udt 插入的 类似问题
将 oracle 查询转换为用户定义的类型pl/sql
用于关联。数组插入:
http://forums.oracle.com/forums/thread.jspa ?messageID=4370850�
但一个好的待遇是您已经安装了一些示例
%ORA_HOME%\odp.net\samples\2.x\UDT
(还有 assoc.array 和其他 odp 类型的其他示例)
让我知道这是否有帮助
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
Converting oracle query into user defined types in pl/sql
for the assoc. array insert:
http://forums.oracle.com/forums/thread.jspa?messageID=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