Home » SQL & PL/SQL » SQL & PL/SQL » executing oracle procedure in visual basic
executing oracle procedure in visual basic [message #205990] Tue, 28 November 2006 05:10 Go to next message
soujanya_srk
Messages: 111
Registered: November 2006
Location: HYDERABAD
Senior Member
my aim is to execute an oracle stored procedure from
visual basic..

i am almost there...but i am unaware of how to use the execute
method of command object in visual basic...can anyone help me
out?

i have a stored procedure


procedure apmc_proc(indno in apmc.dno%type,
                                      indname in apmc.dname%type,
                                      inqual in apmc.qual%type)

is

begin

 insert into apmc values(indno,indname,inqual);

  commit;

end;



IN VISUAL BASIC, i am giving the following code


Public Sub MYPROC()

With p1
      .Direction = adParamInput
      .Type = adNumeric
      .Value = 10
      End With
      
      With p2
      .Direction = adParamInput
      .Type = adBSTR
      .Value = "Gautam"
      End With
      
      With p3
      .Direction = adParamInput
      .Type = adBSTR
      .Value = "MCA"
            
      End With
      With Q1
      .CommandText = "SCOTT.APMC_PROC"
      .CommandType = adCmdStoredProc
      .ActiveConnection = con
      .Parameters.Append p1
      .Parameters.Append p2
      End With
      
      Q1.Execute [B]( i am getting error here as i have to pass arguments[/B])

   
   MsgBox "procedure executed", vbInformation, "GAUTAM"
   
End Sub




i am calling this procedeure at a click of a button

the problem is...this procedure has 3 arguments, and I am
unaware of how to pass those 3 arguments when i execute it
in visual basic using command objectname.execute

anyone ever did this kind of thing before?

Re: executing oracle procedure in visual basic [message #206000 is a reply to message #205990] Tue, 28 November 2006 05:57 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
maybe add a .Parameter.Append p3 ??
Re: executing oracle procedure in visual basic [message #206010 is a reply to message #205990] Tue, 28 November 2006 06:10 Go to previous messageGo to next message
soujanya_srk
Messages: 111
Registered: November 2006
Location: HYDERABAD
Senior Member
yes, that was the mistake i did

thank you
Re: executing oracle procedure in visual basic [message #206013 is a reply to message #205990] Tue, 28 November 2006 06:12 Go to previous message
soujanya_srk
Messages: 111
Registered: November 2006
Location: HYDERABAD
Senior Member
as you see it has nothing to do with visual basic

a general observation i failed to make after i coded it

Embarassed
Previous Topic: A small clarification regd update statement.
Next Topic: converting long raw into blob in a procedure over a database-link
Goto Forum:
  


Current Time: Wed Dec 07 18:41:40 CST 2016

Total time taken to generate the page: 0.07244 seconds