OracleCommand Object with stored procedure in Oracle 10.2 (ODP.Net)

 Dear All!

 i am using the oracle command with oracle database (v 10.2), the  command object has some parameters, some of them are of type input and 2 of them are of type Out put. But when we execute the command the output parameter of the command object shows the null value. i do not know wot is the exact problem.

 

here is the code

 Private Sub PrepareInTransitCommand(ByRef pCancelCompleteLog As DA.Common.CancelCompleteLog, _
                                         ByRef pCommand As OracleCommand)

        With pCommand
            'Attatches the Parameters
            .Parameters.Add(New OracleParameter("p_business_unit_id", OracleDbType.Varchar2, 2, ParameterDirection.Input))
            .Parameters.Add(New OracleParameter("p_division_id", OracleDbType.Varchar2, 5, ParameterDirection.Input))
            .Parameters.Add(New OracleParameter("p_last_receipt_date", OracleDbType.Date, 7, ParameterDirection.Input))
            .Parameters.Add(New OracleParameter("p_comp_prcnt", OracleDbType.Single, ParameterDirection.Input))
            .Parameters.Add(New OracleParameter("p_it_number", OracleDbType.Double, ParameterDirection.Input))
            .Parameters.Add(New OracleParameter("p_cancel_complete_ind", OracleDbType.Varchar2, 1, ParameterDirection.Input))
            .Parameters.Add(New OracleParameter("p_transaction_id", OracleDbType.Int64, ParameterDirection.Output))
            .Parameters.Add(New OracleParameter("p_return_status", OracleDbType.Int64, ParameterDirection.Output))
            .Parameters.Add(New OracleParameter("p_error_msg", OracleDbType.Varchar2, 2000, ParameterDirection.Output))


            'Sets Values
            .Parameters.Item("p_business_unit_id").Value = pCancelCompleteLog.BusinessUnitId
            .Parameters.Item("p_division_id").Value = pCancelCompleteLog.DivisionId
         
        End With

    End Sub

 

' Now Excecute command

public sub Main () 

    Call PrepareInTransitCommand(pCancelCompleteLog, lCmd) 

  lCmd.ExecuteReader()
                    ' Check the Return Value which works fine here
                    If Not lCmd.Parameters.Item("p_return_status").Status = 0 Then

                                'Do Some thing

                    End If

 

            but  the Below parameter throws null, where as i checked the stored procedure which works fine. no problem in procedure

                lCmd.Parameters.Item("p_transaction_id") 
 

End Sub 

 


kindly tell me any  body if some body have same issue in Oracle. 

0
Salmanniaz
5/27/2008 1:06:18 PM
asp.net.oracle 2269 articles. 0 followers. Follow

0 Replies
1040 Views

Similar Articles

[PageSpeed] 15

Reply:

Similar Artilces:

Problem with Oracle Stored Procedures using ODP.NET in VB.NET (VS 2003)
This is the stored procedure,Procedure RetrieveReservations(pProperty In Varchar2,pResHeaderId In Varchar2,pEmail In Varchar2,pPasswd In Varchar2,ResultSet In Out ResCursor);This is the old .asp code (part of it)objConn.ConnectionString = Application("BackEndConnection_ConnectionString")objConn.Open objComm.ActiveConnection = objConn objComm.CommandText = "internet_package.RetrieveReservations"objComm.CommandType = adCmdStoredProc objComm.Parameters.Append objComm.CreateParameter("pProperty", adVarChar , adParamInput, 8, Request.QueryString("propid"))objComm.Parameters.Append objComm.Crea...

Return an Oracle Ref Cursor to a .NET DataReader object by using the .NET Managed Provider for Oracle
Hello, I am wondering if anyone in this community knows the shorter way to return an Oracle Ref Cursor to a .NET DataReader object by using the .NET Managed Provider for Oracle, something likereturn (IDataReader) SqlHelper.ExecuteReader(ConnectionString, "GET_ACCOUNT", Id); instead of using the way below (look at the C# code) Stored Procedure create or replace PROCEDURE "GET_ACCOUNT" ( p_ID IN ACCOUNT.ID%type, retCursor OUT SA.MYGEN.sqlcur ) IS BEGIN OPEN retCursor FOR SELECT ID, NAME FROM ACCOUNT WHERE ID = p_ID ; ...

Oracle store procedure problem using Powerbuilder and Oracle 8.0.4.0 Net
Powerbuilder version 6.0.00 / 6.5 Build 444 Oracle Net 8.0.4.0 I found there is problem with Oracle store procedure having more than 6 in parameters. I got GPF error on Window 95 and Dr. Watson error on NT. Also, I found it works find in Oracle Net 8.0.3.0. Is this a bug? Is there any new patch for this if it is a bug. Any recommendation about What version Oracle Net or SQL Net should I used for Oracle server version 8.0.4.0 (I don't think I am using any Oracle 8 new features)? Thanks in advance, Sharon Li If you use PB 6.5, you can try the new Oracle 8 driver: ftp...

Support for dw.NET 2.5 in VS 2008, .NET framework 3.5 and Oracle 10.2g
Hi, I intend to use the datawindow.NET 2.5 in VS 2008 (.NET framework 3.5) using a Oracle 10.2g database as a backend and later using Oracle 11g as backend. Can someone please let me know if the product is supported in the environments mentioned. All help will be highly appreciated and many thanks in advance. Regards Hasan Kasamali On Nov 24, 3:06=A0am, Hasan Kasamali wrote: > Hi, > > I intend to use the datawindow.NET 2.5 in VS 2008 (.NET > framework 3.5) using a Oracle 10.2g database as a backend > and later using Oracle 11g as backend. > > Can ...

Oracle ODP.net mulitple Oracle Client
To connect to the oracle database using ODP.net, the applicate must add the dll file called Oracle.DataAccess. There are a lot of version of Oracle.DataAccess. As I know, if the client use Oracle Client 10g Release 2. If the client use Oracle Client 10g Release 2, the application also have to use the Oracle.DataAccess the come from Oracle Client 10g Release 2.  My question is that there are any method to add more than one Oracle.DataAccess version in my product to support multiple OracleClient.   That should automatically happen for the most part.  Oracle's ODP.NET i...

Oracle stored procedure with .net
Dear all I wrote a following stored procedure and program coding. ------------------------------------------------------------------------------------------ Stored procedure ------------------------------------------------------------------------------------------- create or replace procedure Delete_emp (p_empno  number) is begin     delete from emp      where empno = p_empno; end delete_emp; ---------------------------------------------------------------------------------------------- program coding ---------------------------------...

urgent: .NET Provider for Oracle or Oracle Data Provider for .NET
If I want to access Oracle DB in ASP.NET application, and I am using .NET Provider for Oracle or Oracle Data Provider for .NET, should I have to install OracleClient on my .NET server? Is there other choice? Thank you very much.Johnson Johnson2007:should I have to install OracleClient on my .NET server?  You have to options1. install the ODP.NET on your web serverOR2. put the oracle assemblies in your BIN directory   Hi jimmy,Thank you for you reply. Because I could not find a server right now, I should test it first before I agree or disagree with you, as most articles I...

is there any way to call oracle stored function, not stored procedure using .net?
I am just wondering if I can call oracle stored function instead of stored procedure.Thank in advance! you call a function just like s procedure.except you need to add a parameter for the return value.myparam ... ParameterDirection.ReturnValue;--dweezilSELECT * FROM users WHERE clue = 'yes';Records found: 0...

PLS-00221: is not a procedure or is undefined FUNCTIONS VS. STORED PROCEDURES
PLS-00221: is not a procedure or is undefined FUNCTIONS VS. STORED PROCEDURES - ADO.NET TO ORACLE FUNCTION   I have a very simple oracle function I'm trying to call from ado.net. The code works fine for a stored procedure but I get the error  PLS-00221: is not a procedure or is undefined  when I try to call the function. here's my code:  I've manually tested both the function and stored procedure and they are both working as expected.  here's my  vb.net code Protected Overrides Sub OnLoad(ByVal e As EventArgs) Dim cnn As OracleConnection Dim sConnSt...

vb.net function and Oracle procedure to get an Oracle Dataset??
I have similar code (a procedure and function) working perfectly with a sql server data source. I;'m trying to do the same things with Oracle, but have run into the problems.    I'm not an oracle expert, so I'm not sure if producing a cursor is my only and best  option. create or replace package body PK_RETAILER isPROCEDURE sp_Get_Order_History(v_ani IN number,output_cursor out PK_CURSORES.generic_cursor) ASBEGINopen output_cursor forselect o.account_number, p.phone, o.amount, o.name, o.init_datefrom orders ojoin users_phones p on p.account_number...

Storing and retrieving GUIDs in Oracle with ODP.Net
We're using Oracle 10g and ODP.Net. Sometimes the GUIDs are generated by Oracle, sometimes by .NET, so we need a universal way to store them and use RAW16. (Is this the right choice?) From my ASP.NET app I write GUIDS like this: dbParameter.Value = ((Guid)key).ToByteArray(); dbParameter.OracleDbType = OracleDbType.Raw; dbParameter.Size = 16; To read them I tried using this:byte[] buffer = new byte[16]; reader.GetBytes(keyColumn, 0, buffer, 0, 16); Guid key = new Guid(buffer); The problem is, it doesn't work. The new Guid constructor treats the first 4 bytes of the arr...

Passing a .NET collection to a Oracle Stored procedure?
In my ASP.NET page I have a list box.  For each row in the list box, I need to invoke an Oracle SP that inserts some data. How would I go about passing the contents of the list box collection to the Stored procedure so that I can loop through it?   Hi,   If you're using Oracle's ODP.net provider, it allows you to pass PLSQL Associative Arrays, which would be the equivalent of passing an array of strings.    I don't believe Microsoft's ODP has that functionality though so if you're using it you'd probably need to concatenat...

Passing boolean values to oracle function / procedure from C#.Net
Hi,  I dont know how to pass boolean values to oracle function / procedure arguments, could you please help me to know ?  Thank you, Sreedhar After spending lot of time on google, I understand C#.Net doest support PL/SQL boolean values. Thanks Sreedhar...

which is shou i use? Microsoft .NET Framework 1.1 Data Provider for Oracle and the Oracle Data Provider for .NET
Microsoft .NET Framework 1.1 Data Provider for Oracle and the Oracle Data Provider for .NETI am confused?Which is better or which one should I use?BTW, I am going to use .net 2.0 with oracle 9. Can anyone tell me what shou I use for working with oracle database?Thanks very much in advance!Justin Oracle's data provider has more functionality than Microsoft's.If your doing transaction processing you can have SAVEPOINTs, which Microsoft's data provider does not provide.Also, Oracle has PL/SQL Associative Arrays which are very powerful.Oracle also allows you to bind parameters by name and pos...

Web resources about - OracleCommand Object with stored procedure in Oracle 10.2 (ODP.Net) - asp.net.oracle

Oracle Data Provider for .NET Classes
... Id=scott;Password=tiger;Data Source=oracle"; OracleConnection con = new OracleConnection(constr); con.Open(); // Execute a SQL SELECT OracleCommand ...

Resources last updated: 12/8/2015 12:08:47 PM