TOraclePackage and Timestamp

Martin B

Member²
I have a PL/SQL package with some timestamp parameters (just plain timestamp, no timezone or local timezone)

I delphi I hold the timestamp in a TDateTime attribute.

e.g. Original date string:
24-JAN-2008 8:40:15.472 AM

When using TOraclePackage to call the insert procedure I notice that the milisecond values in the timestamp are truncated.

e.g. One the database:
24-JAN-2008 8:40:15.000 AM

However, if I use a TOarcleQuery and define the bind varables to call the same package the milisecond information in the timestamp is preserved.

BEGIN
p_my_package.procedure(:var1, :var2,...);
END;

e.g. One the database:
24-JAN-2008 8:40:15.472 AM

Is this an issue with TOraclePackage or am I missing something?

Oracle DB 10.2.0.3 (dvlp) and 9.2.0.7 (test)
Client (OCI) also 9.2.0.7
 
In that case Oracle will convert the timestamp to a date, which will indeed lose the milliseconds. You can get it as a string data type through the TOraclePackage, or use a TOracleQuery and pass a TOracleTimestamp variable to the call.
 
Back
Top