oracle 11g proc用于接受集合/ int of int throw c#oledb [英] oracle 11g proc for accepting collection/Array of int throw c# oledb

查看:61
本文介绍了oracle 11g proc用于接受集合/ int of int throw c#oledb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要更新oracle 11g db表,例如

G_X_Table => groupid(fk),itemid(fk)

Group_Table => groupid(PK),groupName

Item_Table => itemid(PK),itemName



我需要在更新(插入,删除)时编写存储过程。我必须将一个groupId和ItemId集合传递给过程,其中insert带有groupid和collection的G_X_Table,那些需要删除的项集合中没有。请帮我写程序。



我需要通过C#与oledb连接调用此程序,请有人帮助我。我是oracle的新手。通过c#连接。



我的想法:删除表单G_X_Table其中groupid =输入groupid并插入带有新值的G_X_Table。但我很困惑我需要在程序中接受项目集合的类型以及我需要传递的oledb类型作为输入参数。



在此先感谢..

I need to update oracle 11g db tables like
G_X_Table => groupid(fk),itemid(fk)
Group_Table => groupid(PK),groupName
Item_Table => itemid(PK),itemName

I need to write a stored procedure while updating(insert,delete).I have to pass one groupId and ItemId collection to procedure where insert G_X_Table with groupid and collection,those are not there in item collection those need to delete. Please help me to write procedure.

I need to call this Procedure through C# with oledb connection please anybody help me. I am very new with oracle..connection through c#.

my idea: delete form G_X_Table where groupid=input groupid and insert G_X_Table with new values. But I am confused what the type i need to accept item collection in procedure and what oledb type i need to pass as input parameter.

Thanks in advance..

推荐答案

收集,我的解决方案是在C#中循环插入/删除。目前,我还没有找到任何方法将数组或集合从C#传递给oracle,如果你发现,欢迎与我分享。
for collection, my solution is loop insert/delete in C#.Currently, i haven't found any way to pass a array or collection from C# to oracle, if you found, welcome to share with me.


对于使用OLEDB的Oracle,请查看此

如何使用OLE DB .NET数据提供程序和Visual C#.NET访问Oracle数据库 [ ^ ]

要将列表发送到存储过程,请检查此提示/技巧(虽然它适用于SQL服务器,但您也可以为Oracle创建相同的内容) ,试试Google)

使用逗号分离SQL IN子句中的值参数字符串 [ ^ ]
For Oracle using OLEDB, check this
How To Access an Oracle Database by Using the OLE DB .NET Data Provider and Visual C# .NET[^]
To send list to stored procedure, check this Tip/Trick(Though it's for SQL server but you could create same for Oracle too, try Google)
Using comma separated value parameter strings in SQL IN clauses[^]


这篇关于oracle 11g proc用于接受集合/ int of int throw c#oledb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆