Board index » delphi » Passing datetime with milliseconds to stored proc

Passing datetime with milliseconds to stored proc

I have a dialect1 database with a stored proc that has a date type input

In Delphi, I'm assigning that parameter like this:

   paramByName('log_timestamp').asDateTime := now;

However, the milliseconds are not being stored in the db.  I have
verified this by doing a 'select cast(log_timestamp) as char(50))', and
it always shows .000 as the milliseconds.

So the question is, how can I pass a dateTime thru a stored proc so that
the milliseconds are stored?


Bob M..


Re:Passing datetime with milliseconds to stored proc

"Craig Stuntz [TeamB]" wrote:
>         IB's handling of milliseconds is marginal at best.  The DB file
> itself can store them, but the IB date APIs are based on a C TM struct
> which simply has no place for ms.  So you can either write UDFs which
> read/write the raw field data or you can just use a NUMERIC column to
> store the milliseconds as an integer.

Thanks Craig.  That explains it.

I'm going to modify the routine to add a sequence number to each row
based on GetTickCount.  That should allow me to pull them out in order.

Bob M..

Other Threads