Oracle存储过程中如何将字符串转化成日期类型
答案:2 悬赏:80 手机版
解决时间 2021-02-20 02:48
- 提问者网友:箛茗
- 2021-02-19 08:07
create or replace procedure pro_base_equipment_submit( v_equipment_id in varchar2, v_equipment_name in varchar2, v_specification in varchar2, v_quantity in varchar2, v_ok_status in varchar2, v_use_sites in varchar2, v_scc_gb in varchar2, v_sc_dt in varchar2, v_gz_dt in varchar2, v_enterprise_id in varchar2, v_sign in varchar2) isbegin if(v_sign = 1) then insert into super_enterprise_equipment ( equipment_id , equipment_name, specification, quantity, ok_status, use_sites, scc_gb, sc_dt, gz_dt, enterprise_id ) values ( seq_equipment_id.NEXTVAL, v_equipment_name, v_specification, v_quantity, v_ok_status, v_use_sites, v_scc_gb, to_date(v_sc_dt,'YYYY-MM-DD HH24-MI-SS'), to_date(v_gz_dt,'YYYY-MM-DD HH24-MI-SS'), v_enterprise_id ); else update super_enterprise_equipment set equipment_name = v_equipment_name, specification = v_specification, quantity = v_quantity, ok_status = v_ok_status, use_sites = v_use_sites, scc_gb = v_scc_gb, sc_dt = to_date(v_sc_dt,'YYYY-MM-DD HH24-MI-SS'), gz_dt = to_date(v_gz_dt,'YYYY-MM-DD HH24-MI-SS'), enterprise_id = v_enterprise_id where equipment_id = v_equipment_id; end if; commit;end pro_base_equipment_submit;报错:Caused by: java.sql.SQLException: ORA-01830: 日期格式图片在转换整个输入字符串之前结束ORA-06512: 在 "SA.PRO_BASE_EQUIPMENT_SUBMIT", line 19ORA-06512: 在 line 1
最佳答案
- 五星知识达人网友:鸠书
- 2021-02-19 09:12
乱七八糟的,你让别人怎么帮你解答~
全部回答
- 1楼网友:神鬼未生
- 2021-02-19 10:41
方法应该没错的,调试一下,看看传入的时间字符串是不是不对
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯