Page 1 of 1

Question with SELECT on Timestamp field in NET-Mode

Posted: Fri 06 Jan 2006 13:25
by heuckeg
When I build a SELECT statement with a WHERE clause on a timestamp field, I have a different behaviour of TOraQUERY in normal and net mode.

In normal (= not net) mode I have to define date and time in country dependent format (germany: 'dd.tt.yyyy hh:mm:ss') for WHERE clause and altering value via FieldByName().AsString.

In net mode I have to define date and time in the format 'dd-mmm-yyyy hh:mm:ss' (e.g. 01-Dec-2005 17:00:00) for WHERE clause and country dependent format for altering value via FieldByName().AsString.

Any setting of TOraSession.Options.DateLanguage has no effect.

Is this a well known and also "wanted" behaviour?
Is there perhaps a "workaround" or can I set a value to have a similar
reaction in both modes?

My problem is that I can't use the same code for both modes now.

best regards (and a nice weekend)
Gunter

Posted: Fri 13 Jan 2006 14:32
by Paul
Net mode does not use parameters of Oracle client from registry.
Try to execute the following statement after establishing connection

Code: Select all

ALTER SESSION SET NLS_TERRITORY ='AMERICA'
TOraSession.Options.DateLanguage affects the NLS_DATE_LANGUAGE parameter.