I have an insert query which contain two fields (params) of type TOraTimeStamp and it's working fine, but since I'm inserting bulk records, I would like to change to DML. (Will not use loader and lmDirect as I'm connecting via Direct TCP mode).
For the Insert statement I have to use:
Code: Select all
n_StartDateTime : TDateTime
...
Query.ParamByName('START_DATETIME').AsSQLTimeStamp := DateTimeToSQLTimeStamp(n_StartDateTime);
Code: Select all
Query.ParamByName('START_DATETIME').AsDateTime := n_StartDateTime;
Since the type of Variant and TSQLTimeStamp are not compatible, even knowing that I would have issue with the milliseconds, I tried first using the
Code: Select all
v_StartDateTime[i]:= n_StartDateTime;
Code: Select all
sqPut.ParamByName('START_DATETIME').Value := v_StartDateTime;
I'm getting the error:
(Other fields from type string, integer are working fine)EVariantTypeCastError 'Could not convert variant of type (Array Variant) inyo type (OleStr)'
After the initial attempts I used the OraLoader and it worked using the field START_DATETIME as ftTimeStamp and passing the n_StartDateTime to it, but again I'm losing the milliseconds information.
Since I'm using a Direct Connection, I would prefer doing the data loading by hand instead using the OraLoader, but just to inform my problems with the milliseconds and all the methods I tried.
Now I need a solution to insert data to my TimeStamp field without losing the millisecond information.
Thank you
PS: Using ODAC 9.4.14, Delphi XE7 and Oracle 11 R2