Skip to main content

Good Morning,


I'm having an issue with a datetime value entered via a smart object and saved to an oracle database.


Setup:


I have a SmartObject with the following properties


Name: DATECREATED


Type: Date Time


SmartBox: checked


--------------------------------------


Name: OBJECTID


Type: Decimal


Key & SmartBox: checked


I have a SmarbObject create method that is written against an Oracle data table. The data table has the following definition:


Column                    DataType


OBJECTID               NUMBER


DATECREATED      DATE


When I execute the smart object method via the management console I enter the following data:


ObjectID: <any number>


Date: 12/31/2011


When I execute the method. It errors out with the following error:


Message: Devart.Data.Oracle.OracleException (0x80004005): ORA-01843 not a valid
month at Devart.Data.Oracle.OracleTimeStamp.a(String A_0, Int32 A_1, Int32&
A_2, Int32 A_3, Int32 A_4, Int32 A_5, Int32 A_6, String A_7) at
Devart.Data.Oracle.OracleTimeStamp.a(String A_0, String A_1, OracleDbType A_2,
Int16& A_3, Byte& A_4, Byte& A_5, Byte& A_6, Byte& A_7,
Byte& A_8, Int32& A_9, SByte& A_10, SByte& A_11, Int32&
A_12, Int32 A_13) at Devart.Data.Oracle.OracleDate.Parse(String value) at
Devart.Data.Oracle.OracleParameter.a(OracleDbType A_0, Object A_1, Object A_2,
Bytej] A_3, Hashtable A_4, Int32 A_5, Int32 A_6, Int32 A_7, Int32 A_8, Int32
A_9, Boolean A_10, OracleConnection A_11, ParameterDirection A_12, String A_13,
au A_14, Boolean& A_15) at Devart.Data.Oracle.OracleParameter.a(ab& A_0,
Boolean A_1, OracleConnection A_2, ByteC] A_3, Hashtable A_4, au A_5,
Boolean& A_6, Int32 A_7) at Devart.Data.Oracle.OracleCommand.a(y A_0, Int32
A_1,


Here are some examples of date formats I have tried ...


12/31/2011


12-31-2011


12/31/11


12-31-11


31-Dec-11


31-DEC-11


31-Dec-2011


31-DEC-2011


All of these date time combinations generate the same result. Has anyone had any experience with inserting a date time value into an oracle database via a smart object?

Devart.Data.Oracle.OracleTimeStamp: 


Represents the Oracle TIMESTAMP, TIMESTAMP WITH TIME ZONE, TIMESTAMP WITH LOCAL TIME ZONE data types.

Can you use Devart.Data.Oracle.OracleDate instead?


Represents the Oracle DATE data type.


Good Morning Peter,


Thank you for your answer. Perhaps you can help me further. My connection to the Oracle database is a direct connection so I'm not sure how to change the object from OracleTimeStamp to OracleDate.


Is this a setting on the smart object itself? or is it located within K2 at all?


Thank you,


Scott Vercuski


You wrote a ServiceObject that connects to Oracle, and you are using DevArt Oracle driver?


What is your insert or update statement look like?


Hi dear, 

How was this problem solved?


Reply