Hi,
Say I have a transaction which goes like this:
begin;
insert into stuff;
do some nondatabase things based on last inserted id;
update a date in stuff;
commit;
It seems that if the date is out of the database range, everything is
thrown out. Is it possible to catch the database error and use a null date
instead, without throwing everything away?
Right now I only have two ways of proceeding:
1) commit before trying to update the date. And if things still don't work
- database has some non date related error, try to delete the previously
inserted stuff.
2) Make sure the dates are nice before trying to stick them in.
Unless there are I'll have to do 2).
Inserting stuff like
'27 Oct 19999 18:21:00 +0800' causes errors even though datetime supposedly
handles dates up to 1465001 AD.
I guess that's expected, and I should insert big years using another less
ambiguous format. What is the recommended format?
Thanks,
Link.