简体   繁体   English

将数组从.Net应用程序传递到Oracle存储过程

[英]Passing an array from .Net application to Oracle stored procedure

I need to pass an array from C#.net application to oracle stored procedure. 我需要将一个数组从C#.net应用程序传递给oracle存储过程。 Can anyone please let me know how to go about it? 任何人都可以让我知道如何去做吗? Also, which OracleType type do I use in C# when passing input parameter to stored procedure? 另外,在将输入参数传递给存储过程时,我在C#中使用哪种OracleType类型?

FYI, am using System.Data.OracleClient in my C# app. 仅供参考,我在C#app中使用System.Data.OracleClient。

Thanks. 谢谢。

Jimmy, the System.Data.OracleClient does not support arrays. Jimmy,System.Data.OracleClient不支持数组。
http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/57a59fba-09e2-46cb-a072-6706b3ec5131 http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/57a59fba-09e2-46cb-a072-6706b3ec5131

Depending on your need, you will either need to implement this via nested table types (via UDTs or assoc. arrays) using the ODP.net clients. 根据您的需要,您需要使用ODP.net客户端通过嵌套表类型(通过UDT或assoc。数组)实现此目的。 This is probably a good direction to go, esp. 这可能是一个很好的方向,尤其是。 since .net 4.0 has deprecated System.Data.OracleClient . 因为.net 4.0已弃用System.Data.OracleClient

But if you are stuck with the System.Data.OracleClient and you are really just trying to do a variable in-list, you can do this by passing in a string and following some of these suggestions: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:210612357425 但是如果你坚持使用System.Data.OracleClient并且你真的只是想在列表中做一个变量,你可以通过传入一个字符串并遵循以下一些建议来做到这一点: http//asktom.oracle。 ?COM / PLS / asktom / F p = 100:11:0 :::: P11_QUESTION_ID:210612357425

hope this helps 希望这可以帮助

You should use DB-defined nested table types to pass an array to PL/SQL. 您应该使用DB定义的嵌套表类型将数组传递给PL / SQL。 Take a look at this nice tutorial , it might help you. 看看这个很好的教程 ,它可能会对你有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM