Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Running PL/SQL Stored Procedure from C# using ADO.net (PL/SQL Table Datatype)

Posted on 2003-10-27
2
Medium Priority
?
1,841 Views
Last Modified: 2007-12-19
Hi,

I am trying to run a third party PL/SQL stored procedure held on an Oracle database, using an ADO.net command in a C# application. However, I cannot match a PL/SQL Table datatype parameter in the stored procedure with any ADO.NET datatype.

Using OO4O in VBA I am able to create a table-parameter using OraDatabase.Parameters.AddTable. Is there any way of doing this in ADO.NET?

Thanks in advance...

 
0
Comment
Question by:tgannetts
2 Comments
 

Accepted Solution

by:
chrisalexander earned 300 total points
ID: 9639724
Oh the pain... I just finished dealing with the issue of using OraTypes in C# and it hurt. Firstly, I believe that Oracle's native .NET provider called Oracle Data Provider (ODP.NET) supports PL/SQL table collections. Go to Oracle.com to download ODP.NET on your dev workstation. Secondly, if this doesn't work then things are going to get alittle messy because you will have to unbox OraTypes to OO4O types. I would recommend using VB.NET and OO4O to create a unit test case of manipulating the PL/SQL table collection. F10 through this block of code to observe the OO4O datatype of each variable. In C# you will have to declare variables of these datatypes (ie OraCollection ObjCol;). Because the RunTime is serverely type safe you will need to unbox the PL/SQL table collection item OraTypes to the OO4O datatypes.

Although Oracle bitches about not supporting OO4O with .NET and the cominterop penalty I have been able to get a web-based app working just fine using Object data types. Just be careful if you use OO4O connection pooling as it does NOT remove connections when shutting down the application; connections become inactive and require some Oracle admin sniping/killing skill.

P.S. log onto MetaLink and explore. Again, the techs are pretty bitchy about answering OO4O/C# related questions though.

Hope this helps,

Chris
0
 
LVL 5

Author Comment

by:tgannetts
ID: 9656426
Thanks Chris,

I had a look at ODP, but we have Oracle 8i - Oracle 9i required.

As you suggested, I tried using OO4O in vb.net. The code I had already written in vba transferred nicely with little re-working required. (in fact with dbnull.value support it worked a lot better).

As far as C# is concerned, as a quick work around I have put all my vba code into a vb.net class library, and am referencing this from my C# application.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question