标签:
存储过程 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[8]; paras[0] = new OracleParameter("OBJEFIRT_parms", OracleType.NVarChar); paras[0].Value = cbinf.ObjeFirT; paras[1] = new OracleParameter("OBJEDATT_parms", OracleType.NVarChar); paras[1].Value=cbinf.ObjeDatT.ToString(); paras[2]= new OracleParameter("OBJESECT_parms",OracleType.NVarChar); paras[2].Value = cbinf.ObjeSecT; paras[3] = new OracleParameter("OBJECONTENT_parms", OracleType.NVarChar); paras[3].Value = cbinf.ObjeContent; paras[4] = new OracleParameter("ISRELEASE_parms", OracleType.Int32); paras[4].Value = cbinf.IsRelease; paras[5] = new OracleParameter("OBJECODE_parms", OracleType.NVarChar); paras[5].Value = cbinf.ObjeCode; paras[6] = new OracleParameter("TAGS_parms", OracleType.NVarChar); paras[6].Value = cbinf.Tags; paras[7] = new OracleParameter("OBJ_ID_parms", OracleType.Int32); paras[7].Direction = ParameterDirection.Output; SQLHelper.ExecuteScaler(InsertInfo_Obj, CommandType.StoredProcedure, paras); int i=Convert.ToInt32(paras[7].Value); return i;
标签:
原文地址:http://www.cnblogs.com/zcwry/p/5631965.html