修改資料庫的日期顯示格式
資料庫移植後,程式裡的所有類似insert into table (aaa_date) values('20050101')的語句都執行失敗,原因是日期格式發生了變化。[@more@]
1。SQL> alter session set nls_date_format='yyyymmdd';
Session altered
SQL> alter system set nls_date_format='yyyymmdd';
alter system set nls_date_format='yyyymmdd'
ORA-02096: specified initialization parameter is not modifiable with this option
2。 修改.profile檔案,增加引數export nls_date_format='yyyymmdd',執行該檔案並重新啟動資料庫例項,失敗,日期仍為原來格式
3。spfile裡增加引數nls_date_format='yyyymmdd',仍失敗
4。用trigger
SQL> create or replace trigger SetDate AFTER Logon On Database
2 Begin
3 Execute Immediate 'Alter Session set NLS_DATE_FORMAT = ''YYYYMMDD''';
4 END;
5 /
OK
問題算繞過去了,但是如果不用trigger,能不能修改資料庫日期格式呢?還不是很確定。
有高手路過請給個答案或提示。謝謝!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/207/viewspace-801452/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 修改sqlplus中顯示時間日期的格式SQL
- Layui表格日期格式顯示UI
- 關於oracle日期格式顯示格式Oracle
- django 設定日期顯示格式Django
- 自定義 RMAN 顯示的日期時間格式
- 設定RMAN顯示的日期時間格式
- 對 oracle 資料庫日期格式,以及對日期操作的理解Oracle資料庫
- TOAD和PLSQL 預設日期顯示、rowid顯示、TNSNAME的修改SQL
- 修改oracleasm的listdisks和querydisk命令顯示格式OracleASM
- Asp.net日期字串格式化顯示ASP.NET字串格式化
- Oracle資料庫日期格式轉換操作Oracle資料庫
- SAP Fiori應用裡日期格式的顯示奧祕
- sqlserver資料庫日期如何格式化-日期轉換字串SQLServer資料庫字串
- Asp.net 日期字串格式化顯示方法ASP.NET字串格式化
- Pandas日期資料處理:如何按日期篩選、顯示及統計資料
- Oracle 修改預設日期格式Oracle
- 如何深度定製 Ubuntu 皮膚的時間日期顯示格式Ubuntu
- mysql資料庫修改新增Date格式列的方法MySql資料庫
- 顯示資料庫中表的主鍵資料庫
- *.cpl檔案的妙用(隨意修改cpu顯示資料,記憶體顯示隨意修改等等)記憶體
- 快速修改所有資料夾的顯示屬性(轉)
- 在Delphi中處理資料庫日期型欄位的顯示與輸入 (轉)資料庫
- win10如何修改時間日期格式 調整時間格式和日期格式的方法Win10
- 顯示資料庫所有引數資料庫
- MySQL顯示連線的資料庫名MySql資料庫
- 資料庫顯示圖片的問題資料庫
- Linux命令之date - 顯示、修改系統日期時間Linux
- 資料庫日期資料庫
- 動態顯示資料庫圖片資料庫
- win10系統長日期格式顯示怎麼設定 win10系統設定長時間格式顯示的步驟Win10
- jira修改RoadMap裡的時間格式,硬核日期格式化
- sql server日期格式 sqlserver的日期格式SQLServer
- 顯示資料庫中所有表的記錄數資料庫
- Layui 表格資料修改成功後重新整理顯示UI
- 【sga】資料庫啟動時的的SGA大小顯示資料庫
- 如何能保證頁面顯示的資料與資料庫的資料同步資料庫
- MUI DtPicker 顯示自定義日期UI
- Android MPAndroidChart LineChart 顯示資料格式化Android