Using c++ builder tokyo 10.2.1, unidac 7.1.4.
new vcl project
->TOracleUniProvider
->TUniConnection, oracle connection in direct mode, settings: UseUnicode true, UnicodeEnvironment true, dateFormat YYYY-MM-DD, dateLanguage french, schema cec. Connect.
->TUniQuery->Select * from table
->TUniDataSource linked to TUniQuery
->TCRDBGrid linked to TUniDataSource
=> Date fields appear as DD-MM-YY.
BUG: Oracle date format ignored
Re: BUG: Oracle date format ignored
To display the date in the format you need using any DB Aware components (DBGrid, CRDBGrid, etc.),
use the DisplayFormats property of the corresponding TDateTimeField: docwiki.embarcadero.com/Libraries/Tokyo ... playFormat
use the DisplayFormats property of the corresponding TDateTimeField: docwiki.embarcadero.com/Libraries/Tokyo ... playFormat
Re: BUG: Oracle date format ignored
I don't have any TDateTimeField.
I just have a TUniQuery "select * from table" displaying content in TCRDBGrid.
The date-time columns should respect format given in TUniSession.
I just have a TUniQuery "select * from table" displaying content in TCRDBGrid.
The date-time columns should respect format given in TUniSession.
Re: BUG: Oracle date format ignored
According to our documentation (devart.com/unidac/docs/?oraprov_article.htm), the DateFormat option specifies the date format for conversion to a string on the server side. When specifying this property (for example, 'YYYY-MM-DD'), the following query is executed: ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD'. The result of its work is demonstrated by the following query: SELECT SYSDATE AS DATETIMEVALUE, TO_CHAR(SYSDATE) AS STRINGVALUE FROM DUAL
Re: BUG: Oracle date format ignored
The problem is in TCRDBGrid.
If I create a vcl app with tuniconnection, direct mode to oracle, date format='YYYY-MM-DD', tuniquery with select dtin from cec.joblist where rownum<2, tunidatasource and tcrdbgrid, the value displayed is 20-04-17 14:20:23. So TCRDBGrid totally ignores the date format of TUniConnection.
Even executing alter session in a tuniquery DOESN'T change the way date/times are displayed in tcrdbgrid.
This was working fine with ODAC!
So question is : how do I ask TCRDBGrid to display date/times the way chosen in TUniSession?
Code: Select all
SQL> desc cec.joblist;
Nom NULL ? Type
----------------------------------------- -------- ----------------------------
ID NOT NULL NUMBER(9)
DTIN NOT NULL DATE
...
SQL> select dtin from cec.joblist where rownum<2;
DTIN
--------
30/12/99
SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD';
Session modifiÚe.
SQL> select dtin from cec.joblist where rownum<2;
DTIN
----------
1899-12-30
Even executing alter session in a tuniquery DOESN'T change the way date/times are displayed in tcrdbgrid.
This was working fine with ODAC!
So question is : how do I ask TCRDBGrid to display date/times the way chosen in TUniSession?
Re: BUG: Oracle date format ignored
To investigate the issue, please compose and send us a small sample, in which the issue occurs. This is convenient to do this via the e-support form ( devart.com the "Support"\"Request Support" menu)