LoginSignup
3
1

More than 5 years have passed since last update.

Oracle Database の NLS_CALENDAR に "Japanese Imperial" を指定して元号を出す。

Posted at

表題の通りとしか言いようが無いやな彡(゚)(゚)
Oracle Database の NLS_CALENDAR に ”Japanese Imperial"を指定すると、
日付データを元号に変換できるんやで。

$ export NLS_CALENDAR="Japanese Imperial";
$ sqlplus /nolog

SQL*Plus: Release 12.1.0.2.0 Production on Wed 1 11 22:20:04 0029

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

SQL> CONNECT xxxxxxxx/xxxxxxxx
Connected.
SQL> SELECT SYSDATE FROM DUAL;

SYSDATE
---------------------------------------------
平成290111

SQL>

マ?彡(゚)(゚) こんな機能が……初めて知ったやで……彡(-)(-)
マニュアルは下記となります(`・ω・)ゞ

3
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1