compiler error during scripting Oracle stored procedure

A

Andy

How to find out or catch compiler error during scripting stored procedure
via OracleCommand class?

E.g.

OracleCommand _oracleCommand = new OracleCommand();
.......


StringBuilder sb = new StringBuilder();

sb.AppendLine("create or replace procedure test_proc(var_number in
number) as");
sb.AppendLine("begin");
sb.AppendLine(" insert into test_table (data) values (var_number);");
sb.AppendLine(" any wrong code;");
sb.AppendLine("end;");

_oracleCommand.CommandText = sb.ToString();

_oracleCommand.Connection.Open();
_oracleCommand.ExecuteNonQuery();
_oracleCommand.Connection.Close();


ADO .NET throws no exception, bu stored procedure is not valid. Is any
solution?

TIA
 
J

Jim Brandley

Try this:

Select status from user_objects where object_name = 'TEST_PROC';

This will return VALID if it is.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top