存储过程
CREATE OR REPLACE PROCEDURE ADMIN.INSERT_OBJ (
OBJEFIRT_parms IN NVARCHAR2,
OBJEDATT_parms IN NVARCHAR2,
OBJESECT_parms IN NVARCHAR2,
OBJECONTENT_parms IN NVARCHAR2,
ISRELEASE_parms IN INTEGER,
OBJECODE_parms IN NVARCHAR2,
TAGS_parms IN NVARCHAR2,
OBJ_ID_parms OUT INTEGER
)
IS
BEGIN
INSERT INTO ADMIN.CB_OBJECT (OBJEID,
OBJEFIRT,
OBJEDATT,
OBJESECT,
OBJECONTENT,
ISRELEASE,
OBJECODE,
TAGS)
VALUES (ADMIN.CYANBIRD.NEXTVAL,
OBJEFIRT_parms,
TO_DATE (OBJEDATT_parms, 'YYYY-MM-DD hh24:mi:ss'),
OBJESECT_parms,
OBJECONTENT_parms,
ISRELEASE_parms,
OBJECODE_parms,
TAGS_parms)
RETURN OBJEID INTO OBJ_ID_parms; RETURN;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
WHEN OTHERS
THEN
-- Consider logging the error and then re-raise
RAISE;
END INSERT_OBJ;
C#中获取值 DbParameter[] paras = new OracleParameter[];
paras[] = new OracleParameter("OBJEFIRT_parms", OracleType.NVarChar);
paras[].Value = cbinf.ObjeFirT;
paras[] = new OracleParameter("OBJEDATT_parms", OracleType.NVarChar);
paras[].Value=cbinf.ObjeDatT.ToString();
paras[]= new OracleParameter("OBJESECT_parms",OracleType.NVarChar);
paras[].Value = cbinf.ObjeSecT;
paras[] = new OracleParameter("OBJECONTENT_parms", OracleType.NVarChar);
paras[].Value = cbinf.ObjeContent;
paras[] = new OracleParameter("ISRELEASE_parms", OracleType.Int32);
paras[].Value = cbinf.IsRelease;
paras[] = new OracleParameter("OBJECODE_parms", OracleType.NVarChar);
paras[].Value = cbinf.ObjeCode;
paras[] = new OracleParameter("TAGS_parms", OracleType.NVarChar);
paras[].Value = cbinf.Tags;
paras[] = new OracleParameter("OBJ_ID_parms", OracleType.Int32);
paras[].Direction = ParameterDirection.Output;
SQLHelper.ExecuteScaler(InsertInfo_Obj, CommandType.StoredProcedure, paras);
int i=Convert.ToInt32(paras[].Value);
return i;