{"id":45,"date":"2008-08-18T01:21:14","date_gmt":"2008-08-18T01:21:14","guid":{"rendered":"http:\/\/degenio.com\/blog\/2008\/08\/why-you-need-to-worry-about-nls_date_format\/"},"modified":"2008-08-18T01:21:14","modified_gmt":"2008-08-18T01:21:14","slug":"why-you-need-to-worry-about-nls_date_format","status":"publish","type":"post","link":"http:\/\/degenio.com\/blog\/2008\/08\/why-you-need-to-worry-about-nls_date_format\/","title":{"rendered":"Why you need to worry about NLS_DATE_FORMAT !"},"content":{"rendered":"<p>One of those things that can irritate you for more than you can care of: the mix up in dates. That&#8217;s an old story for those dealing with the Oracle Db but in our case, that was something that bothered us for more than a week before we found out that we were missing the environment variable NLS_DATE_FORMAT in our report server setup.<\/p>\n<p><!--more--><\/p>\n<p>In our old C\/S forms 6i setup, we used to have 2 ways of getting reports out.\u00a0 Either Preview or Printer with a submission form that has all the report parameters.\u00a0 In most cases, we needed a <strong>START DATE<\/strong> and an <strong>END DATE<\/strong> . Those were always supposed to be in the format <strong>DD\/MM\/YYYY<\/strong> since we use FRENCH_CANADIAN as our NLS_LANG. In the add_parameters statement, a <strong>to_date<\/strong> with the proper format was systematically used. However, in the report module, the receiving parameter was setup as CHARACTER with length 10. That was working fine in the C\/S version. Remember that each user could have his own report on his own machine. The registry in this case had a value setup for NLS_DATE_FORMAT and NLS_LANG.<\/p>\n<p>On 10g, this was giving us a TERMINATED_WITH_ERROR message each time the report was called. One way to fix the error was to set the user parameter for the dates as DATE with the proper format (DD\/MM\/YYYY).<\/p>\n<p>But that was calling for a big change since we had a high number of submission screens.\u00a0 Looking at the <a title=\"Oracle 10g environment variables\" href=\"http:\/\/www.oracle.com\/webapps\/online-help\/reports\/10.1.2\/state\/content\/navId.3\/navSetId._\/vtTopicFile.htmlhelp_rwbuild_hs|rwrefex|envvars|envvar_1nav~htm\/vtTopicId.\/\" target=\"_blank\" title=\"Oracle 10g environment variables\">environment variables<\/a> for Oracle reports\u00a0 10g release 2, it was obvious that we needed to have both NLS_LANG and NLS_DATE_FORMAT setup properly.<\/p>\n<p>For the time being, we changed NLS_LANG to AMERICAN_AMERICA.WE8MSWIN1252 and NLS_DATE_FORMAT to DD\/MM\/YYYY <strong>on the report server<\/strong> and that fixed our problems. However, it is more than likely that NLS_LANG will be changed to FRENCH_CANADIAN.WE8MSWIN1252 to make it compatible with our other setup.<\/p>\n<p>Note: When checking the server environment (with showenv at the end of the url), NLS_DATE_FORMAT does not show up in the list.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of those things that can irritate you for more than you can care of: the mix up in dates. That&#8217;s an old story for those dealing with the Oracle Db but in our case, that was something that bothered us for more than a week before we found out that we were missing the [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[8,1],"tags":[19,20,18],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/phEMW-J","_links":{"self":[{"href":"http:\/\/degenio.com\/blog\/wp-json\/wp\/v2\/posts\/45"}],"collection":[{"href":"http:\/\/degenio.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/degenio.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/degenio.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/degenio.com\/blog\/wp-json\/wp\/v2\/comments?post=45"}],"version-history":[{"count":0,"href":"http:\/\/degenio.com\/blog\/wp-json\/wp\/v2\/posts\/45\/revisions"}],"wp:attachment":[{"href":"http:\/\/degenio.com\/blog\/wp-json\/wp\/v2\/media?parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/degenio.com\/blog\/wp-json\/wp\/v2\/categories?post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/degenio.com\/blog\/wp-json\/wp\/v2\/tags?post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}