oracle中,25-09-14怎么转换成日期格式:yyyy-mm-dd,已经试过to_char()和to_date()
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/06/01 12:08:07
oracle中,25-09-14怎么转换成日期格式:yyyy-mm-dd,已经试过to_char()和to_date(),都报错;
FUNCTION get_order_date(p_segment1 IN VARCHAR2, p_organization_code IN VARCHAR2) RETURN VARCHAR2 IS
RESULT VARCHAR2(1000);
BEGIN
FOR cur IN (SELECT to_date(to_char(oola.schedule_ship_date, 'yyyy-mm-dd'), 'yyyy-mm-dd') schedule_ship_date
FROM oe_order_headers_all ooha,
oe_order_lines_all oola,
mtl_system_items_b msib,
mtl_system_items_tl msit,
mtl_parameters mp
WHERE ooha.header_id = oola.header_id
AND oola.inventory_item_id = msib.inventory_item_id
AND oola.ship_from_org_id = msib.organization_id
AND msib.inventory_item_id = msit.inventory_item_id
AND msib.organization_id = msit.organization_id
AND msit.language = userenv('LANG')
AND oola.ship_from_org_id = mp.organization_id
AND oola.flow_status_code = 'AWAITING_SHIPPING' --销售订单行状态为:Awaiting_Shipping的明细
AND msib.segment1 = p_segment1
AND mp.organization_code = p_organization_code
AND (ooha.order_source_id IS NULL OR ooha.order_source_id 10)) LOOP
log('RESULT : ' || RESULT);
RESULT := RESULT ||cur.schedule_ship_date || ',
';
END LOOP;
RESULT := rtrim(RESULT, ',');
RETURN(RESULT);
END get_order_date;
输入的格式现在是25-09-14这种,我想让它输出2014-09-25
FUNCTION get_order_date(p_segment1 IN VARCHAR2, p_organization_code IN VARCHAR2) RETURN VARCHAR2 IS
RESULT VARCHAR2(1000);
BEGIN
FOR cur IN (SELECT to_date(to_char(oola.schedule_ship_date, 'yyyy-mm-dd'), 'yyyy-mm-dd') schedule_ship_date
FROM oe_order_headers_all ooha,
oe_order_lines_all oola,
mtl_system_items_b msib,
mtl_system_items_tl msit,
mtl_parameters mp
WHERE ooha.header_id = oola.header_id
AND oola.inventory_item_id = msib.inventory_item_id
AND oola.ship_from_org_id = msib.organization_id
AND msib.inventory_item_id = msit.inventory_item_id
AND msib.organization_id = msit.organization_id
AND msit.language = userenv('LANG')
AND oola.ship_from_org_id = mp.organization_id
AND oola.flow_status_code = 'AWAITING_SHIPPING' --销售订单行状态为:Awaiting_Shipping的明细
AND msib.segment1 = p_segment1
AND mp.organization_code = p_organization_code
AND (ooha.order_source_id IS NULL OR ooha.order_source_id 10)) LOOP
log('RESULT : ' || RESULT);
RESULT := RESULT ||cur.schedule_ship_date || ',
';
END LOOP;
RESULT := rtrim(RESULT, ',');
RETURN(RESULT);
END get_order_date;
输入的格式现在是25-09-14这种,我想让它输出2014-09-25
to_date('25-09-14','dd-mm-yy') 可以转换成日期类型,输出可以用 to_char再格式化.
oracle中,25-09-14怎么转换成日期格式:yyyy-mm-dd,已经试过to_char()和to_date()
oracle转换函数 to_date,to_char,to_number问题,求指教!
excel表日期格式转换MM/DD/YYYY的转YYYY-MM-DD
excel日期格式"mm/dd/yyyy"如何转换"yyyy/mm/dd"?
怎么将excel中的yyyy.mm.dd日期格式统一改成mm/dd/yyyy的格式
excel表出生日期格式转换成yyyy/mm/dd
EXCEL表格中如何把yyyy.mm.dd-yyyy.mm.dd改成yyyy.mm-yyyy.mm
java中日期类型的数据(yyyy-MM-dd HH:mm:ss)减一天怎么写?
日期和时间的正则表达式:时间格式是yyyy-MM-dd hh:mm:ss和MM-dd hh:mm:ss和hh:mm:ss
Excel中如何将数字转换成日期格式?
Birth Date (mm/dd/yyyy)
英语填生日 格式要求mm/dd/yyyy 比如我是1990年3月7日该怎么填