Subject | Re: [firebird-support] expressing time as a numeric vale in dialect 3 |
---|---|
Author | Martijn Tonies |
Post date | 2005-06-08T14:48:31Z |
Hello Peter,
No, it wants a time.
point value.
Cast it to TIME.
With regards,
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
> I have a trigger on an insert on a table and I'm trying to set a timefield in dialect 3 to
> a calculated value. (basically spaced at 1 min intervals from midnight to7 am, then
> back to midnight as id wraps around by using modulus)?
>
> If I use
>
> new.contact_time = '00:00:01' it works
>
> if I use
>
> new.contact_time = new.id * (1.000/1440)
>
> it compiles but fails when inserting records as I think it wants a string
No, it wants a time.
> I know time is stored as a 32 bit integer and I want to set it at thislevel with an
> integer modulus calculation.You're not calculating a time, the result of your calculation is a floating
> Any ideas how I can set this field by calculation ?
point value.
Cast it to TIME.
With regards,
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com