some problems in OCI by using c++

zhouguoyao 2008-05-12 08:46:29
Hello
I have a column with a DATE format;
I need to format the output, but using the <select> query of this determined column.
I must use ( due to my VC++ program requirements) the next command:
select * from MY_TABLE
Using only this statement the output format is YY-MM-DD and I need YY-MM-DD-HH-MM-SS.
I know how to use TO_CHAR and in fact using SQL*Plus works well.
It's possible to format a column inside the <select * from MY_TABLE> statement?
Thanks
...全文
112 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
sailing0123 2008-08-20
  • 打赏
  • 举报
回复
楼上的没错,很简单!

在构造SQL语句,
在select时,使用to_char()
在insert时,使用to_date(),
两函数使用相同的时间格式'YYYY-MM-DD HH24:MI:SS'
或者其它格式

搞定!
ghtghtmalone 2008-05-16
  • 打赏
  • 举报
回复
oracle 的date类型也是带时分秒的啊?
有什么问题呢?
和下面的语句不是样能处理吗?
select to_char(sysdate,'yyyymmddhh24miss') from dual
zhouguoyao 2008-05-15
  • 打赏
  • 举报
回复
谢谢
DiligencyMan 2008-05-14
  • 打赏
  • 举报
回复
帮顶下
不太懂,关注中。
zhouguoyao 2008-05-12
  • 打赏
  • 举报
回复
在c++中使用OCI对数据库进行操作。
问题:
对date类型的处理好像有些问题,select过来的date字段数据,都缺少了时、分、秒信息,只能精确到天

请高手帮忙分析下,谢谢!

17,140

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧