TOracleDataSet's DateTime field problem

mazhigang

Member
My test table create dcript:
CREATE TABLE Test(col1 integer,
col2 date not null);
I use col2 to store only time, and my code just like below:
table1.Insert;
table1.FieldByName('Col1').AsInteger := 0;
table1.FieldByName('Col2').AsDateTime := EncodeTime(0,0,0,0); //00:00:00 zero time
table1.Post;
When execute the up code, I get a error message 'ORA-01400:can't insert a NULL value("test"."col2")', but use bde or ado can work
well. Is something I do wrong? Can the zero time be saved? if can, how do I?
My oracle version: 816 for windows
My doa version: for delphi 3.4.3
thank you!
 
By default Direct Oracle Access will treat 0.0 dates as NULL. To prevent this, you can set TOracleSession.Preferences.ZeroDateIsNull to False.

------------------
Marco Kalter
Allround Automations

[This message has been edited by mkalter (edited 23 September 2002).]
 
Back
Top