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

x
?
Solved

Calling Oracle Stored Procedure from Visual Basic

Posted on 2001-09-17
6
Medium Priority
?
244 Views
Last Modified: 2013-11-25
I am using Visual Basic 6 with Oracle 8i Database at the backend.
I have written a stored procedure on Oracle which has one input parameter and one output parameter.
How can i call the stored procedure from visual basic . I need to pass the input parameter while calling the procedure and store the result returned by Procedure via output parameter.

Thank You,

Naresh
0
Comment
Question by:ATIRAS
[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 15

Expert Comment

by:lyonst
ID: 6487252
0
 
LVL 15

Expert Comment

by:lyonst
ID: 6487275
Also,

HOWTO: Call a Parameterized Stored Procedure in Oracle from a Recordset DTC

http://support.microsoft.com/directory/article.asp?ID=KB;EN-US;Q240337

Cheers,

T.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6487417
I do something similar to:

Set cmd = New ADODB.Command
With cmd
   .ActiveConnection = "connection string goes here"
   .CommandType = adCmdStoredProc
   .CommandText = "package.storedproc"
   .Parameters.Append .CreateParameter("inputvar", adChar, adParamInput, 100, "inputvar value")
   .Parameters.Append .CreateParameter("o_status", adInteger, adParamOutput)
   .Execute Options:=adExecuteNoRecords
End With

Debug.Print cmd("o_status").Value

Set cmd = Nothing

Anthony
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6487420
Also, when you get a chance, please maintain your open questions.  For the record:

Questions Asked 8
Last 10 Grades Given  
Question Grading Record 0 Answers Graded / 0 Answers Received
0
 

Accepted Solution

by:
krs_rama earned 300 total points
ID: 6489434
hi,
The following codes would sove your problem

With cmd
 
  .ActiveConnection = oradb  'Opening connection for Stored proc-
     'oradb is opened using the normal Ado Open and i tried with scott/tiger by creating a
     'stored procedure named pp with one number parameter
 
 
  Dim IntValue, IntRecsAffected As Integer
  IntValue = 120  'value passed (ONE PARAMETER ) to test the procedure
 
  .CommandType = adCmdStoredProc
  .CommandText = "PP"   'pp  denotes the procedure name
  .Parameters.Append .CreateParameter("intvalue", adInteger, adParamInput, 20, 20)
  .Execute IntRecsAffected, IntValue, Options:=adExecuteNoRecords
 
End With

Set cmd = Nothing

i have tried the above codes and the stored procedure works !

Regards,
Krs_rama
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Suggested Courses

649 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