Oracle date formatting implementation

Source: Internet
Author: User

For oracle databases, oracle date Formatting cannot be left blank. The following describes the implementation methods of oracle date formatting in detail, hoping to give you a deeper understanding of oracle date formatting.

1. Use the to_date statement to insert date data.
For example, to insert a value in a column of each date, such a statement is required.

Insert into data_table values ('20170', 0, 'xiaoming', todate ('2017-01-01 01:02:03 ', 'yyyy-MM-DDHH24: MI: ss ');

2 oracle default time and date format is

'Dd-Mn-YYYYHH24: MI: ss' but the default time character conversion format for java, delphi is 'yyyy-MM-DDHH: MMI: ss ', to enter the corresponding format in oracle, you must modify the time and date format of oracle.

Input: show parameter nls

You can view all the parameters.

Enter show parameter nls_date_format

You can check the nls_date_format parameter.

Select sysdate from dual;

You can view the Type format of the time and date functions.

The oracle Date Format statement is

Altersessionsetnls_date_format = 'yyyy-MM-DDHH24: MI: ss ';

However, it is found that this method can only modify the level session.

I had to find a proper method and finally found a solution to the problem by modifying the registry.

Find registry home0

Add the new string NLS_DATE_FORMAT

With the value of YYYY-MM-DD HH24: MI: SS you can later query by format YYYY-MM-DD

You can also modify parameters of other types in a similar way ,.

Oracle memory structure-SGA

Learn about the ORACLE resource role

Oracle data export and import Permissions

Oracle read-only user role creation

View oracle user permissions

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.