I have an oracle script which is having a procedure say below stored at some location.
create or replace procedure test
is
begin
update testTable
set input=1
where input2=4;
end test;
....
What I have to do is to fetch this script using C #..create this proc through C# code and then execute it...
This is code i have written..
public void Something()
{
string path= "something";
FileInfo files= new FileInfo(path);
string script = files.OpenText().ReadToEnd();
OracleCommand cmd= new OracleCommand(conn);
cmd.CommandText = script;
cmd.ExecuteNonQuery();
cmd.CommandType=CommandType.StoredProcedure;
cmd.CommandText= "test";
cmd.cmd.ExecuteNonQuery();
}
Above i am facing error 00905 object is invalid error...
I having with creating a transaction and commiting it but have not worked.
Also tried to use the schema name with the proc but the same error.
I am sure that the proc is just created and it is not compiling ...
coz just after creating the proc through and without executing it through code;
If i execute it through the database then also the same error.
This doesnt seems to be the roles and rights issue...just I need that proc should be created and compile.
Please if any one can help me this.
Sorry . I didnt mentioned that I am also creating that table (test) before the proc through code...i.e fetching the script of the table and executing it..and in the proc I am using that table...may be if that is causing the issue..