-
Notifications
You must be signed in to change notification settings - Fork 455
Oracle procedure
so edited this page May 22, 2021
·
1 revision
Chloe 支持存储过程以及 output 参数。
通过存储过程获取一个 Person 信息: Oracle 数据库中,如果一个存储过程需要返回结果集,需要借助 RefCursor output 参数特性。用法如下:
/* 必须先自定义 RefCursor 参数 */
OracleParameter p_cur = new OracleParameter();
p_cur.ParameterName = "p_cur";
p_cur.OracleDbType = OracleDbType.RefCursor;
p_cur.Direction = ParameterDirection.Output;
DbParam refCursorParam = new DbParam();
/* 将自定义 RefCursor 参数设置到 DbParam 的 ExplicitParameter 属性 */
refCursorParam.ExplicitParameter = p_cur;
DbParam id = new DbParam("id", 1);
Person person = dbContext.SqlQuery<Person>("Proc_GetPerson", CommandType.StoredProcedure, id,refCursorParam).FirstOrDefault();
通过存储过程的 output 参数获取一个 Person 的 Name:
DbParam id = new DbParam("id", 1);
DbParam outputName = new DbParam("name", null, typeof(string)) { Direction = ParamDirection.Output };
dbContext.Session.ExecuteNonQuery("Proc_GetPersonName", CommandType.StoredProcedure, id, outputName);
熬夜的时候容易引起脱发,熬夜时人的免疫力会下降,还会引起内分泌的变化,导致皮脂分泌增多,这些因素都不利于头发的生长,有可能引起脱发。如果出现熬夜脱发的情况,需要及时纠正日常的生活习惯,合理安排休息时间,早睡早起,适当的锻炼身体,多进食优质的蛋白质,增强身体的抵抗力,促进头发的生长。
发量有限,远离996!!!