Timestamp and Bool types in Zope
Hi I'm trying to insert or select timestamp and bool types into a postgres database and I'm using PoPyDA. Zope seem to only have types string, text and int, unless I missed something somewhere. Please help as I'm a newbie? Thanks Grant
You might be thinking about the dtml-sqlvar, right? the sqlvar is just there to help you create a long text string, the SQL statement. Use the syntax of strings or int however it suits you to produce the SQL text string you need. Cheers, Peter From: "Grant Murphy" <Grant.Murphy@eskom.co.za> Hi I'm trying to insert or select timestamp and bool types into a postgres database and I'm using PoPyDA. Zope seem to only have types string, text and int, unless I missed something somewhere. Please help as I'm a newbie? Thanks Grant _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Wed, Apr 04, 2001 at 10:07:07AM +0200, Grant Murphy wrote:
Hi
I'm trying to insert or select timestamp and bool types into a postgres database and I'm using PoPyDA. Zope seem to only have types string, text and int, unless I missed something somewhere. Please help as I'm a newbie?
you already had a partial answer, here is a more complete one. (An aside) postgres uses only strings for all internal communication; numbers are converted to ASCII before interprocess send and back again on receipt. This makes debugging issues go away, and removes 'endianness' messes. So, in priciple, the type=int is not real useful (in fact it quotes differently, so it IS important) To specify a timestamp or a bool, just use the normal cast notation. i.e. insert into .... 'now'::timestamp or insert into .... <dtml-sqlvar due_date type=string>::timestamp etc.
Thanks Grant
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Grant Murphy -
Jim Penny -
Peter Bengtsson