开发者

Is it possible to send a Int[] to an Oracle Stored Procedure using OleDb

Is it possible to send an int[] from a c# application using OleDb to an Oracle Stored开发者_如何学C Procedure?

I was wondering if there is a specific way of setting up both c# OleDbType and the type in the Oracle stored procedure. At the moment I am using this kind of setup.

C#

int[] intArray = new int[] { 1, 2};

cmd.Parameters.Add(new OleDbParameter("var_name", intArray));
cmd.Parameters[i].OleDbType = OleDbType.Variant
cmd.Parameters[i].Size = 20;

Oracle

TYPE intArray IS TABLE OF NUMBER;
PROCEDURE proc(var_name IN intArray);

Thankyou in advance - Ankou


Managed to fix my own problem.

Seeing as no one has came up with a solution I decided to fix this problem by sending in a string of CSV, then created a split method in order to add each value to TABLE OF VARCHAR2(30) INDEX BY BINARY_INTEGER; which could then be used elsewhere.

So have a solution and a String Split function too :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜