I am trying to apply a function by using odp.net into my oracle database but I cannot, woul you mind help me please? This program suppose to apply all the backend object for me into my database.( A file which is contain several ddl script[insert, create table or delete and alter table], apply function, procedure or package)
I am doing this activity for automate apply objects in our client side.
This software should work same as PLEdit software.
textbox1.text :
create or replace FUNCTION bfn_severity_temp (p_severity CMMT_FIX_MASTER.N_severity%TYPE)
RETURN VARCHAR2
IS
BEGIN
IF p_severity = 1 THEN
RETURN 'Mission Critical';
ELSIF p_severity = 2 THEN
RETURN 'High';
ELSIF p_severity = 3 THEN
RETURN 'Medium';
ELSIF p_severity = 4 THEN
RETURN 'High';
END IF;
END;
My c# code in as below:
try{
OracleConnection oConn = new OracleConnection(ConnectionString);
//OracleTransaction trans = oConn.BeginTransaction(IsolationLevel.ReadCommitted);
OracleCommand oc = new OracleCommand();
//oc.CommandType = CommandType.TableDirect;
oc.CommandText = textBox1.Text;
//oc.Transaction = trans;
oc.Connection = oConn;
int i = 0;
oConn.Open();
i = oc.ExecuteNonQuery();
oConn.Close();
MessageBox.Show(i.ToString());
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
MessageBox.Show(ex.Message);
}
MessageBox.Show(ex.Message);