NAME
DBIO::Oracle::Storage::ConnectSetup - Oracle session NLS setup on connect
VERSION
version 0.900007
DESCRIPTION
Sets the Oracle session NLS date/timestamp formats to ISO (NLS_DATE_FORMAT YYYY-MM-DD HH24:MI:SS, NLS_TIMESTAMP_FORMAT YYYY-MM-DD HH24:MI:SS.FF, NLS_TIMESTAMP_TZ_FORMAT YYYY-MM-DD HH24:MI:SS.FF TZHTZM) on every new connection of the driver, the connections of an async pool included. Nothing has to be asked for: without this a session reads dates and timestamps in the server's format (19-OCT-26 04.15.31.601359 AM), which neither the ISO strings of the result classes nor DateTime::Format::Oracle take. A format named in the environment variable of the same name (NLS_DATE_FORMAT ...) is used instead of the ISO one. The format in use is also written to those variables when they are not set: DateTime::Format::Oracle parses with the format of the environment, not of the session, and its own defaults are not ISO.
The call is still there as on_connect_call => 'datetime_setup', for applications that name it: it sets the same formats a second time, which is harmless.
The same step sets NLS_NUMERIC_CHARACTERS to ., (decimal point, group comma) for the session, whatever the territory of the client or the server says. A number goes to the server as text and comes back as text, and both are read and written with the decimal character of the session: under a territory with a decimal comma (NLS_LANG=GERMAN_GERMANY.AL32UTF8) a bound 1.5 was refused with ORA-01722, and a NUMBER, BINARY_DOUBLE or BINARY_FLOAT would have come back as 1,5. With the setting a number makes the round trip with its decimals in every territory. The environment variable NLS_NUMERIC_CHARACTERS does not change it (unlike the date formats); an application that wants another one names it in its own on_connect_do or on_connect_call, which run after and win.
AUTHOR
DBIO & DBIx::Class Authors
COPYRIGHT AND LICENSE
Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.