本文介绍了如何在oracle中将sysdate作为insert语句的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
sb.Append(" INSERT INTO BRANCH ");
sb.Append(" (ID,BRANCHCODE,BRANCHNAME,CONTACTPERSON1,CONTACTPERSON2,ADDRESS_ID,CHECKED,MAKERID,MAKERDATETIME,CHECKERID,CHECKERDATETIME,COMPANY_ID,HEAD_OFFICE) ");
sb.Append(" VALUES (BRANCH_ID_SEQ.NEXTVAL, :BRANCH_CODE, :BRANCHNAME, :CONTACT_PERSON1, :CONTACT_PERSON2, :ADDRESS_ID, :CHECKED, :MAKER_ID, to_date(:MAKERDATETIME,'dd-mm-yyyy hh24:mi:ss'), :CHECKERID, to_date(:CHECKERDATETIME,'dd-mm-yyyy hh24:mi:ss'), :Company_ID, :HEAD_OFFICE) ");
o_Cls_OracleConnect_DML.Parameter_String("BRANCH_CODE", BRANCH_CODE);
o_Cls_OracleConnect_DML.Parameter_String("BRANCHNAME", BRANCHNAME);
o_Cls_OracleConnect_DML.Parameter_String("CONTACT_PERSON1", CONTACT_PERSON1);
o_Cls_OracleConnect_DML.Parameter_String("CONTACT_PERSON2", CONTACT_PERSON2);
o_Cls_OracleConnect_DML.Parameter_String("ADDRESS_ID", ADDRESS_ID);
o_Cls_OracleConnect_DML.Parameter_String("CHECKED", CHECKED);
o_Cls_OracleConnect_DML.Parameter_String("MAKER_ID", MAKER_ID);
// o_Cls_OracleConnect_DML.Parameter_String("MAKERDATETIME", " ,Sysdate ");
o_Cls_OracleConnect_DML.Parameter_String("CHECKERID", CHECKERID);
// o_Cls_OracleConnect_DML.Parameter_String("CHECKERDATETIME", " , SYSDATE");
o_Cls_OracleConnect_DML.Parameter_Int32("COMPANY_ID", Company_ID);
o_Cls_OracleConnect_DML.Parameter_String("HEAD_OFFICE", HEAD_OFFICE);
对于MAKERDATETIME,CHECKERDATETIME当我给sysdate它是以字符串格式采取的无论如何将它作为sysdate插入?
for MAKERDATETIME , CHECKERDATETIME when i give sysdate it is taken in string format is there anyway to insert it as sysdate?
推荐答案
这篇关于如何在oracle中将sysdate作为insert语句的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!