繁体   English   中英

Oracle 数据库 cursor 没有检索正确的日期和时间

[英]Oracle Database cursor not retriving correct date with time

我有一个数据库 cursor 如下:

CURSOR fetchquotedate(account_id IN NUMBER)
    IS
        select distinct(quotedate) 
        from mytable
        where customer_number= 12345;

mytable 中的quotedate值为: 7/27/2020 4:00:00 PM

fetch fetchquotedate into l_qDate;

但是当 cursor 插入l_qDate时, l_qDate只得到 date: 7/27/2020 ,而不是时间。

我怎样才能解决这个问题?

SELECT TO_CHAR(quotedate, 'MM/DD/YYYY HH24:MI:SS A.M.') AS quotedate

TO_CHAR function 添加到您的查询中。 quotedate字段可能是表中的 DATE 类型列,因此不会检索时间。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM