FileMaker, Timestamps, and SQL-92
FileMaker, Timestamps, and SQL-92
- Subject: FileMaker, Timestamps, and SQL-92
- From: Clark Mueller <email@hidden>
- Date: Mon, 22 Aug 2005 21:42:59 -0600
Hello all,
I'm in the midst of a project in which I'm using a FileMaker
database as a back end - a decision I am not necessarily pleased
with, but one that needs to be acknowledged, for the time being. I've
had good success in constructing a working EOModel, and I am able to
insert, delete, and update records just fine. With one exception:
Date, Time, and Timestamp.
Now, the particular one that I am interested in is Timestamp, but
this also extends to the other two as well. What essentially is
happening is that timestamps can be read from the database just fine,
but writing them back fails (or to be more accurate, writes back some
very strange corrupt data). I turned on SQL logging, and then wrote a
quick CLI app using the JDBC driver for FileMaker directly to test
the statement that EOF is generating:
UPDATE Entity SET TimeStatusChanged = "2005-08-22 00:00:00",
TimeUpdateSent = "2005-08-22 00:00:00" WHERE (PrimaryKey = 1 AND
UpdateFlag = 0)
This caused an "internal error (-1)" to be thrown from FileMaker's
JDBC driver, which, as anyone who has used it knows, has almost
nonexistent documentation, including error code meanings.
I combed through the documentation there was, and found the problem:
date, time, and timestamp values must be enclosed in braces {}, while
EOF constructs its statements apparently using quotes instead
(enclosed in quotes, the problem was duplicated exactly from my test).
So then... is there anything I can do about this from the EOF side?
The only solution I have come up with is to change these fields to a
Text format in FileMaker, and write cover methods in the enterprise
object subclass that do the translation between the string and an
NSTimestamp for EOF. I'm of course then at the mercy of making sure
that the data in FileMaker is entered in the correct date format for
conversion, but due to the nature of the solution, that should not be
a huge problem.
But... can anyone do any better? I don't like using band-aids.
Thanks,
Clark
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden