perl - How to set Oracle nls_date_format using Class::DBI -
I have followed the example on wiki.class-dbi.com to change the Oracle session but for this to work Does not seem to be Below is a snippet from my code (removed strict and warning for clarity of problem)
package MyDB; Use Base 'Class :: DBi :: Oracle'; __PACKAGE __- & gt; Connection ('DBI: Oracle: DBNN', 'User', 'Password'); __PACKAGE __- & gt; Db_Main- & gt; Do (q [set session nls_date_format = 'yyyy-mm-dd hh24: mile: ss']); 1; Package MyDB :: TestTable; Use the base MyDB; __PACKAGE __- & gt; Table ('my_test_table'); __PACKAGE __- & gt; Column (.....); 1; Package head; Use MyDB; My @offos = maidi :: test-table- & gt; Search (seq_number = & gt; 1); Foreign exchange mine $ foo (@ ioos) {say $ foo- & gt; Made_time; }
Although the result is not which I expect as yyyy-mm-dd hh24: mi: ss :
Thank you.
Thanks
DBIX :: class
hook provided It looks like you are starting with just the Pearl ORM - you should switch well.
@DSN = ('dbi: Oracle: ...', '...', '...', {autocompt => 1, on_connect_do = & gt; Qq [ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24: MI: SS'], QQ [ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24: MI: SS'], QC [Altter session set NLS_TIMESTAMP_TZ_FORMAT = ' YYYY-MM-DD HH24: MI: SS TZHTZM '],],})
Comments
Post a Comment