How to Execute the Oracle Stored Procedure Using A

Results 1 to 2 of 2

Thread: How to Execute the Oracle Stored Procedure Using A

  1. #1
    Join Date
    Dec 1969

    Default How to Execute the Oracle Stored Procedure Using A

    Hi <BR><BR>I am using a Back End as Oracle I created some Stored Procedure in Oracle.But I don&#039;t Know How to Execute that Using ADO (Active Server Pages).Can u any one help me?<BR>

  2. #2
    Join Date
    Dec 1969

    Default If there is not a FAQ on this

    there should be.<BR><BR>I know I sound like a broken record, but make sure you are using Microsoft&#039;s OLEDB provider (Provider=MSDAORA) to connect. <BR><BR>Here you go:<BR><BR>*************************************** ****************<BR>dim o_balance, parm1, parm2 <BR>dim objCmd <BR><BR>Set objCmd = Server.CreateObject("ADODB.Command") <BR>objCmd.ActiveConnection = getdbconnection() <BR>&#039;***note this is is simply a function I use to get a db connection - replace with your connection info ********** <BR><BR>objCmd.CommandText = "sp_emp_bal" &#039;***stored proc name<BR>objCmd.CommandType = 4 <BR><BR>&#039;****Set input parameter for stored proc(1 = input type)<BR>&#039;****this one is varchar type(i.e.-200)<BR>set parm1 = objCmd.CreateParameter("emp_id",200,1,10,"12345678 9") <BR>objCmd.Parameters.Append parm1 <BR><BR>&#039;****Set in/output paramter for stored proc (3=in/out type)<BR>&#039;****this one is number type(i.e.-131) and <BR>set parm2 = objCmd.CreateParameter("obalance",131,3,50,0) <BR>objCmd.Parameters.Append parm2 <BR>objCmd.Execute <BR><BR>&#039;***Get the value of output parameter returned from stored proc<BR>o_balance = objCmd("obalance") <BR><BR><BR>Good luck<BR><BR>Pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts