ODP.NET Procedure Compilation
- by Bobcat1506
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);
}