Why am I having trouble retrieving data from an Oracle Database when I use English data format (yyyy-mm-dd) in a SELECT statement with the Database Toolbox (R2009b)?
1 view (last 30 days)
Show older comments
I execute the below code, which querys an Oracle Database for records with a certain date range.
cn=database('NAME','','');
e = exec(cn,'select NAME from TABLE where DATA_REF >= ''01-OCT-2009');
f = fetch(e);
I'm not able to retrieve data when my database when I 'OCT' as my month field. I am only able to retrieve data when I use the Italian language setting (OTT instead of OCT):
cn=database('NAME','','');
e = exec(cn,'select NAME from TABLE where DATA_REF >= ''01-OTT-2009');
f = fetch(e);
Accepted Answer
MathWorks Support Team
on 2 Nov 2010
This behavior occurs when the 'ALTER SESSION SET NLS_LANGUAGE' setting in Oracle is not configured to include 'English.' These are NLS (National Language Support) parameters that you can set with database. Each database comes with different languages and defaults.
In order to configure this property, execute the following statment in the Oracle programming environment (SQL plus).
ALTER SESSION SET NLS_LANGUAGE=English;
For more information on all the NLS parameters you can set refer to here:
0 Comments
More Answers (0)
See Also
Categories
Find more on Database Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!