[Zope] Date-Time or SQL (Oracle) time.. or...
Chris Beaumont
cbeaumon@msri.org
Mon, 4 Sep 2000 23:37:49 -0700
Hello,
Another newbie question that I hope doesn't sound too stupid.. (I
guess I already know the answer to that question.. it DOES...
*sheepish grin*)
Have a little patience with me, I'm learning things and having fun,
so in a month or three... *sigh*
Anyway....
I have some questions about the best way to update time fields on my Zope site.
This issue has been "the bane of my life" for the past three days.....*grin*
Basically these are fields in records describing events (programs and
workshops, and soon, talks) which I am listing on my site..
The dates are in an Oracle 7 table. I'm using DCOracle and the Zope
OracleDA to interact with these data sources from Zope.
Quite simply, I'm confused.. I've been following to the letter the
ZSQL Methods Guide, but I'm completely missing something important
about the relationship between Zope date-time and Oracle dates. I've
scoured the lists and haven't found anything there either..How-tos
deal with general date-time issues.. yes.. but this is on the border
.. perhaps.. DateTime vs. Oracle SQL.
*pause for dramatic effect*
The How-tos I've seen don't answer several (basic) questions..
Note: So far I have just been working with dates, not hours, minutes, etc.
I've noticed that if I insert data using Oracle's default and not
very useful "native" format ie. 01-Jan-00 things work on the insert
side. Sort-of...
I've also successfully used "TO_DATE" to insert data in SQLMethods..
in forms I built myself..
But then using the exact same code in another (originally
ZNolk-generated, but much edited..) form and SQL method.. no luck..
It's usually not even making it out of Zope's error check routines..
Perhaps this is a clue.. I've noticed that when displaying the
results of a query, Zope translates Oracle's outputted dates into
Date-Time.
Does Zope also do translation on the input end? And if so, what do I
need to do to be able to consistantly input dates in MM/DD/YYYY
without problems..
I've been having major problems with <dtml-sqlvar> choking on dates
and I don't have the foggiest idea what I am doing wrong. Do I need
to put more effort into learning TO_DATE and TO_CHAR (Oracle-isms)
better or am I totally barking up the wrong tree..
(i.e. Zope translates everything into Date-Time)
What is the best way to intercept SQL so I can see what is being sent
to Oracle..? (I followed the suggestions in the How-to on this
subject and Zope threw an error)
I'm sorry this sounds so stupid, but I have been running into a brick
wall..so to speak.. And in my scheme of things, dates, and the
simple modification of them.. is really important...
Thank you,
Chris