1 2 3 4 5 6 7 8 9 10 11 12 13
|
OracleCommand ocmd = new OracleCommand();
ocmd.Connection = conn;
ocmd.CommandType = CommandType.StoredProcedure;
ocmd.CommandText = "DECLARE status NUMBER; message VARCHAR2(80); pipe_name VARCHAR2(30) := 'BEC'; BEGIN status := DBMS_PIPE.receive_message(pipename => pipe_name, timeout => DBMS_PIPE.maxwait); IF status = 0 THEN DBMS_PIPE.unpack_message(message); DBMS_OUTPUT.put_line('Message received: ' || message); END IF; END;";
ocmd.Parameters.Add(new OracleParameter("message", OracleType.Int32));
ocmd.Parameters[0].Direction = ParameterDirection.Output;
ocmd.Parameters[0].Value = System.DBNull.Value;
ocmd.ExecuteNonQuery();
int x = (int)ocmd.Parameters[0].Value;
label1.Text = Convert.ToString(x); |