Oracle changes session Date Format

Source: Internet
Author: User

Description of Oracle session date format change: the conversion time in the stored procedure should be output in 'yyyy-mm-dd' format, but the output result is not in this format, for example, after '2017-12-31 ', the output is '31-March 12-12'. Solution: If you have checked the information for half a day, you will not be able to say that you have not found the correct keyword, the middle is not easy to find a post with the same problem, there is a layer of the main just said the sentence directly set alter session set NLS_DATE_FORMAT = '| ''' YYYY-MM-DD ''tried, no effect. I set it directly in PL/SQL. Then the running of the stored procedure was ineffective. After a long time, it was not solved. When I was about to give up, I suddenly got inspired to add this sentence to the stored procedure, O. It may be because I am stupid and cannot understand what the previous layer master said. There is a problem. There are two vertical lines in the format. I don't know what the function is, and I didn't try it. Execute immediate 'alter session set NLS_DATE_FORMAT = '| '''dd-MON-RRRR '''; execute immediate 'alter session set NLS_DATE_LANGUAGE =' | '''american '''; (3) in linux: oracle user editing. add the following content under bash_profile: export NLS_DATE_FORMAT = 'yyyy-MM-DD HH24: MI: ss' log on again to take effect (4) log On With sysdba and then update the props $ field in the table to update props $ set value = 'yyyy-MM-DD HH24: MI: s' where parameter = 'nls _ DATE_FORMAT ';

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.