[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to execute and see results of Oracle Stored Procedure from VB.NET

Posted on 2004-09-13
6
Medium Priority
?
458 Views
Last Modified: 2012-08-14
I created a simple SP in oracle like this:
 create or replace procedure TEST_VM(prm_1 IN varchar2,prm_2 IN varchar2,sp_cursor OUT sys_refcursor
)
 is
 begin
 open sp_cursor for select * from nm_Test where ptcpt_cd = prm_1 and ptcpt_nme = prm_2;
 end;
 /

It created and I can run in sql*plus perfectly and I have this code in VB.NET and I'm not able to run the procedure
myCMD.CommandText = "TEST_VJ"
        myCMD.CommandType = System.Data.CommandType.StoredProcedure
 
myCMD.Parameters.Add(New OracleParameter("prm_1", OracleType.VarChar)).Value = "'PARENT'"
        myCMD.Parameters.Add(New OracleParameter("prm_2", OracleType.VarChar)).Value = "'PARENT'"
        myCMD.Parameters.Add(New OracleParameter("sys_refcursor", OracleType.Cursor)).Direction = ParameterDirection.Output

myCMD.ExecuteNonQuery()

What is wrong am I doing

Since I don't have many points that I'm giving only 30 points right now.
Thanks
vm
0
Comment
Question by:vmandem
[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
  • 3
  • 2
6 Comments
 
LVL 7

Accepted Solution

by:
natloz earned 120 total points
ID: 12049021
does it run if you comment out this line?
 
myCMD.Parameters.Add(New OracleParameter("sys_refcursor", OracleType.Cursor)).Direction = ParameterDirection.Output
0
 
LVL 7

Expert Comment

by:natloz
ID: 12049024
You should not have to pass in a return value as far as I know...
0
 
LVL 7

Expert Comment

by:natloz
ID: 12049054
Hold the phone...you may need it actually...are you getting an error?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 10

Expert Comment

by:123654789987
ID: 12051389
Try changing it to

myCMD.Parameters.Add(New OracleParameter("@prm_1", OracleType.VarChar)).Value = "'PARENT'"
myCMD.Parameters.Add(New OracleParameter("@prm_2", OracleType.VarChar)).Value = "'PARENT'"
        myCMD.Parameters.Add(New OracleParameter("@sys_refcursor", OracleType.Cursor)).Direction = ParameterDirection.Output
0
 

Author Comment

by:vmandem
ID: 12054235
natloz

I get the error as:
ORA-06550: line1, column7;
PLS-00306: wrong number or types of arguments
ORA-06550: line1, column7;
PL/SQL: Statment ignored
0
 

Author Comment

by:vmandem
ID: 12054257
123654...

I get this error if I use @:

ORA-01036: illegal variable name/number.

I don't know where excatly it is doing. Can you tell me based on my stored procedure where it is causing.

Thanks
vm
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
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…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

656 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