Subject Re: Timestamp variable with fractional seconds
Author dave@brooksnet.com
--- In firebird-support@yahoogroups.com, Milan Babuskov <milanb@k...>
wrote:
> If he's using parameters he should take care since IBPP is very rigid
> about this, for example, if you wish to insert into date field you
> can't do something like:
>
> string s = "07.02.2005";
> statement->Set(1, s);
>
> Even thought there is Statement::Set(int, string), it won't work since
> it expects the argument to be of IBPP::Date type.

Right; those don't work at all.

> I don't know what is IBPP's behaviour if one does: "INSERT INTO xyz
> VALUES (cast(? as timestamp)". I guess it throws it away as invalid.

The string argument type was not not accounted for in a switch
statement of possible arguments for the timestamp column type. So,
even with valid SQL, the string-to-date cast failed with the IBPP
library. Not surprising since it would be hard to write a correct
library implemntation that allows for completely unexpected arguments.

> I think this should go to IBPP mailing list for detailed discussion. I
> would also be good to read what error does IBPP give.

That's where I went first, and learned that the IBPP time and
timestamp does not support fractional seconds at all. Further reading
in the ApiGuide.pdf doc comfirmed that the ISC encode and decode
routines for time use "struct tm" which doesn't include anything
smaller than a second. So, I came here.

I forget the exact error now but it was along the lines of XSQLDA
invalid type.

Thanks for your input!!! I like FlameRobin, BTW. I'm not really a
suck-up but I do appreciate good workmanship.

Best regards,
Dave