Solved

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

Posted on 2003-10-27
2
1,835 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
chrisalexander earned 100 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

617 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