Oracle如何解决日期格式“01-3月 -18”的显示问题(3种处理方式)

今天查询表数据还是出现上次那种问题,但是每次都要去调用转化函数,比较麻烦,所以找一下资料,得到几种方式解决oralce的日期数据显示格式

问题描述:

解决方法

1)方法1:调用Oracle函数转化成日期格式

-- 方法1:调用函数支持转化成日期格式(每次都要调用转化方法)---
select A.CODE,to_char(cast(cast(A.BEGINDATE as timestamp) as date),'yyyy-mm-dd hh24:mi:ss') BEGINDATE,
 A.ENDDATE,A.STATE from Dxc_Contract A where STATE=9 and ISENABLE=1

查询结果

缺点: 每次取数据的时候都要调用转化函数,比较麻烦

2)方法2:改变session的NLS_DATE_FORMAT值

--方法2 :改变当前会话session的nls_date_format格式 (只支持当前会话)--
 alter session set nls_date_format = 'yyyy-mm-dd hh24:mi:ss';

查询结果

缺点:只对当前会话有用,而不是当前的sql*plus窗口

 3)方法3:在环境变量添加NLS_DATE_FORMAT参数

--方法3:在window 添加环境变量NLS_DATE_FORMAT,值:YYYY-MM-DD HH24:MI:SS--

3.1)在系统变量中添加新的环境变量

3.2)重启pl/sql工具,进行查询

 

这种方式是永久处理NLS_DATE_FORMAT的日期显示格式,建议用这种方式

参考资料:

https://www.cnblogs.com/carekee/articles/4532905.html

https://blog.csdn.net/qiang_gu/article/details/6723466

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
基于JSP的博客系统论文+源码+数据库 基于JSP的博客系统 摘要: Blog是Web blog的缩写,中文就是“网络日志”,在中国我们称它为博客。它被解释为一个特定的软件系统, 被用来在网络上出版、发表和张贴个人的文章并且通常是由简短且经常更新的帖子所构成,这些张贴的文章都按照年份和日期倒序排列。Blog的内容和目的有很大的不同,从对其他网站的超级链接和评论,有关公司、个人构想到日记、照片、诗歌、散文,甚至科幻小说的发表或张贴都有。而此系统也主导这一思想,主要为了完善地实现注册用户发表文章,访客可以匿名发表评论等相关功能来设计,并且完成前台运作和管理。 博客就是以网络作为载体,简易迅速便捷地发布自己的心得,即时有效轻松的与他人进行交流,再集丰富多彩的个性化展示于一体的综合性平台。博客系统可以充分展示每个用户的内心世界、工作感受、技术资料等方面的资讯。博客是个独立站点任何人都可以方便的来使用,就像每个人拥有自己的笔记本开始书写一样简单。 系统功能保留了传统博客系统的功能,同时又加上了人性化的界面设计,比如日历、音乐的引用。完善的数据更新能力、实用的管理以及个性化的设计使本系统能适应博客的发展。 系统页面采用Html语言和Css样式以及JavaScript脚本来设计,系统的相关功能由Java语句来实现,使用Tomcat为服务器,和Oracle 数据库作为后台,采用Jsp+Servlet+JavaBean模式来完成系统的相关功能。主要分为游客角色和用户角色。游客可以注册、查看日志、照片、博主的资料和匿名发表评论。用户则完成写日志、修改日志、上传照片、管理照片、更改个人信息、添加收藏、退出系统等功能。 关键字: 博客 系统 Jsp A BLOG SYSTEM BASED ON JSP Abstracts:Blog is the abbreviation of Web blog, whose Chinese meaning is “the network diary”. In China, we call it Blog, which is explained as specific software used to publish individual articles in the network and usually consists of a brief and frequently updated posts, these articles posted in reverse chronological order, and date. Blog content and purpose are quite different from other websites, the hypertext links and comments about the company, personal diary, photographs, and ideas to poetry, prose, even science fiction published or posted. For this purpose, our system is designed to perfect some correlative functions, such as publish articles for the registration users, publish anonymous comments for the visitors, and complete the foreground operations and managements. Blog is simple to network as the carrier, rapid conveniently released their experiences, instant effectively communicate easily with others, then set colorful personalized display in an integrated platform. Blog system can fully display each user's inner world, work experience and technical data, etc. Blogging is a independent site anyone can easily to use, like everyone has his notebook to write. It not only retains the traditional Blog system, but also adds com personal windows design, such as the quote of calendar, and music. Based on the flawless ability of data renewal, useful backstage management and personal design, this system can adapt to the development of Blog. System using Html page language and Css styles and JavaScript scripts, system design by the relevant function, use Java statements for the server, and Tomcat Oracle database, using a backend Jsp+Servlet+JavaBean mode to complete system of related functions.It mainly divided into tourist roles and user role. Visitors can view the log, photographs, and the material and anonymous blogger comment. Users will finish writing blog, modify log, uploading photos and pictures, the change of personal information management system, add collection, exit etc. functions. Key words:Blog System Jsp 目录 引言 1 1 博客及相关技术概述 2 1.1 个人博客的概念 2 1.2 个人博客的发展现状 2 1.3 WEB技术的发展 2 1.4 WEB开发技术 3 2 需求分析 7 2.1 系统目标 7 2.2 系统功能要求 7 2.3 系统的性能要求 8 2.4 系统的性能要求 9 3 概要设计 10 3.1 系统体系结构 10 3.2 主要功能设计 10 3.3 数据库设计 12 3.4 信息安全设计 14 4 详细设计 15 4.1 首页及主要页面设计 15 4.2 功能模块设计 15 4.3 系统实现 15 5 遇到的难点和解决方法 29 6 结束语 30 参考文献 31 致 谢 39

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值