c# - Get value from oracle stored procedure -
I have an oracle process that should return a given string of all the parameters
Create or process tin_builder (in type varchar2, tin_serial in number, rand_digit in varchar2, varchar2 tin out) is replaced by BEGIN tin: = type || TO_CHAR (Tin_Cirial) || Rand_digit; END
Now I want to call the process from Visual Studio 2008 (C # code)
public zero tinbuilder (string type, long tin_cierial, string RAND_DIGITT} {OracleConnection Connection = New Oracle Connection ("Data Source = xe; User ID = System; Password = ******;"); Oracle Commands CMD = New Oracle Commands (); CMD. Connection = connection; Cmd.CommandText = "tin_builder"; Cmd.CommandType = CommandType.StoredProcedure; Cmd.Parameters.Add ("Type", OracleDbType.Varchar2). Value = type; Cmd.Parameters.Add ("tin_serial", OracleDbType.Decimal) .Value = tin_serial; Cmd.Parameters.Add ("rand_digit", OracleDbType.Varchar2) .Value = rand_digit; Cmd.Parameters.Add ("Tin", OracleDbType.Varchar2). Direction = Parameter Direction Return value; Try {connection.Open (); Cmd.ExecuteNonQuery (); Text box 1 text = CMD Parameter ["tin"]. Value.ToString (); } Hold (Exception Pre) {} Finally {connection.Close (); }}
Then it was called with:
Tinkler ("1", 10000001, "37");
But this does not show any value in the text box :(. Please help me.
And as OMG has changed it and change: SELECT type || TO_CHAR (tin_serial)
Also make sure that you always start exceptions to catch these types of errors
Comments
Post a Comment