ODP.NET Procedure Compilation

Posted by Bobcat1506 on Stack Overflow See other posts from Stack Overflow or by Bobcat1506
Published on 2010-05-04T23:08:20Z Indexed on 2010/05/05 0:18 UTC
Read the original article Hit count: 268

Filed under:
|
|

When I try to execute a create procedure using ODP.NET I get back ORA-24344: success with compilation error. However, when I run the same statement in SQL Developer it compiles successfully. Does anyone know what I need to change to get my procedure to compile? Is it a character set issue?

I am using Oracle 10g Express, .NET 3.5 SP 1, and ODP.NET 2.111.7.20 (version from Oracle.DataAccess.dll)

    [TestMethod]
    public void OdpNet_CreateProcedure()
    {
        ConnectionStringSettings settings = ConfigurationManager.ConnectionStrings["ODP.NET"];
        using (var con = new OracleConnection(settings.ConnectionString))
        {
            con.InfoMessage += new OracleInfoMessageEventHandler(con_InfoMessage);
            con.Open();

            var cmd = new OracleCommand();
            cmd.Connection = con;

            cmd.CommandText = @"
                CREATE OR REPLACE PROCEDURE TABLE1_GET
                (
                  P_CURSOR OUT SYS_REFCURSOR
                )
                IS
                BEGIN

                  OPEN P_CURSOR FOR
                  SELECT * 
                  FROM TABLE1;

                END;";

            cmd.ExecuteNonQuery(); // ORA-24344: success with compilation error

            cmd.CommandText = @"ALTER PROCEDURE TABLE1_GET COMPILE";
            cmd.ExecuteNonQuery(); // ORA-24344: success with compilation error
        }
    }

    void con_InfoMessage(object sender, OracleInfoMessageEventArgs eventArgs)
    {
        System.Diagnostics.Debug.WriteLine(eventArgs.Message);
    }

© Stack Overflow or respective owner

Related posts about .NET

Related posts about odp.net