Home » Open Source » Programming Interfaces » how do i call oracle stored procedure by using oledb.net
how do i call oracle stored procedure by using oledb.net [message #416153] Thu, 30 July 2009 20:44
zhefeng
Messages: 4
Registered: July 2009
Junior Member
For some reason i have to use oledb.net, however the code from vb.net always not work:

this is the stored procedure:
create or replace PROCEDURE                   STP_XMLSIMPLE1 
      (txt_in        IN       varchar2,
       status_message   OUT      VARCHAR2
      )
AS
BEGIN
status_message:='This is the text:'|| txt_in;
END;


And this is the VB.net code:
        Dim dbConn As New OleDbConnection
        Dim dbComm As OleDbCommand

        'dbConn.ConnectionString = "Provider=OraOLEDB.Oracle;User ID=jehan;Password=bobobo;Data Source=rac10u1;" 
        dbConn.ConnectionString = "Provider=MSDAORA;User ID=jehan;Password=bobobo;Data Source=rac10u1;OLEDB.NET=true"
        dbConn.Open()

        dbComm = dbConn.CreateCommand


        dbComm.Parameters.Add("txt_in", OleDbType.VarChar, 100).Direction = ParameterDirection.Input
        dbComm.Parameters.Add("status_message", OleDbType.VarChar, 500).Direction = ParameterDirection.Output

        dbComm.Parameters("txt_in").Value = "jeff test"

        dbComm.CommandText = "{STP_XMLSIMPLE1(?,?)}"
        dbComm.CommandType = CommandType.Text
        dbComm.ExecuteNonQuery()
        MessageBox.Show(dbComm.Parameters("status_message").Value)
        dbConn.Close()


i've tried two providers as you can see. But this code always got failure and the error shows on "dbComm.ExecuteNonQuery()".

Thanks for any help!
Previous Topic: Unable to connect DB through Perl
Next Topic: DBD:Oracle make test failure
Goto Forum:
  


Current Time: Thu Dec 08 00:33:44 CST 2016

Total time taken to generate the page: 0.10559 seconds