Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #36551

Re: Psycopg2 SyntaxError: invalid syntax on "INSERT INTO" database

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <msirenef@lightbird.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'parsing': 0.07; 'strings.': 0.07; 'guys.': 0.09; 'postgres': 0.09; 'python:': 0.09; 'wrong,': 0.09; 'add/subtract': 0.16; 'andy': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'retrieving': 0.16; 'value;': 0.16; 'string': 0.17; 'wrote:': 0.17; 'instance': 0.17; 'jan': 0.18; 'int,': 0.22; 'parse': 0.22; 'script': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'values': 0.26; 'converting': 0.27; 'class': 0.29; 'function.': 0.33; 'minutes,': 0.33; 'text,': 0.33; 'to:addr:python-list': 0.33; 'thanks': 0.34; 'doing': 0.35; 'but': 0.36; 'subject:" ': 0.36; 'why': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'store': 0.38; 'things': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'help': 0.40; 'your': 0.60; 'first': 0.61; 'email addr:gmail.com': 0.63; '2013': 0.84; 'journey': 0.93
Date Wed, 09 Jan 2013 21:56:19 -0500
From Mitya Sirenef <msirenef@lightbird.net>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version 1.0
To python-list@python.org
Subject Re: Psycopg2 SyntaxError: invalid syntax on "INSERT INTO" database
References <b1c7ea47-47b4-4784-8037-e0856fdaa7cd@googlegroups.com> <kcl0p4$ssr$1@reader1.panix.com> <bd7fc6c9-a1d0-4bb0-91cc-435eda94154e@googlegroups.com> <mailman.352.1357780318.2939.python-list@python.org> <717b5860-f35d-4c2f-a227-638568a8aae0@googlegroups.com>
In-Reply-To <717b5860-f35d-4c2f-a227-638568a8aae0@googlegroups.com>
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.356.1357786585.2939.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1357786585 news.xs4all.nl 6866 [2001:888:2000:d::a6]:36239
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:36551

Show key headers only | View raw


On Wed 09 Jan 2013 09:20:10 PM EST, andydtaylor@gmail.com wrote:
> Thanks for your help guys.
>
> I was actually doing a few things wrong, but I have got this script to work by declaring fields as varchar and all values as strings. But I would like to log journey time values in hours/minutes, so I will have to look into the following:
>
> 1. Retrieving this data from postgres as text, converting it and using it. I will need to add/subtract on this time value; or
> 2. Recognising it as a time class in the first instance by using the string parsing function.
>
> Regards,
>
> Andy


Why not store as an int, in minutes, and then parse into h:m
when displaying?

 - m



--
Lark's Tongue Guide to Python: http://lightbird.net/larks/

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Psycopg2 SyntaxError: invalid syntax on "INSERT INTO" database andydtaylor@gmail.com - 2013-01-09 15:52 -0800
  Re: Psycopg2 SyntaxError: invalid syntax on "INSERT INTO" database John Gordon <gordon@panix.com> - 2013-01-10 00:08 +0000
    Re: Psycopg2 SyntaxError: invalid syntax on "INSERT INTO" database andydtaylor@gmail.com - 2013-01-09 16:19 -0800
      Re: Psycopg2 SyntaxError: invalid syntax on "INSERT INTO" database Mitya Sirenef <msirenef@lightbird.net> - 2013-01-09 20:07 -0500
      Re: Psycopg2 SyntaxError: invalid syntax on "INSERT INTO" database MRAB <python@mrabarnett.plus.com> - 2013-01-10 01:11 +0000
        Re: Psycopg2 SyntaxError: invalid syntax on "INSERT INTO" database andydtaylor@gmail.com - 2013-01-09 18:20 -0800
          Re: Psycopg2 SyntaxError: invalid syntax on "INSERT INTO" database Mitya Sirenef <msirenef@lightbird.net> - 2013-01-09 21:56 -0500
        Re: Psycopg2 SyntaxError: invalid syntax on "INSERT INTO" database andydtaylor@gmail.com - 2013-01-09 18:20 -0800
  How to run multiline shell command within python Karim <kliateni@gmail.com> - 2013-01-10 07:01 +0100
  Re: [Tutor] How to run multiline shell command within python Hugo Arts <hugo.yoshi@gmail.com> - 2013-01-10 09:31 +0100
  Re: [Tutor] How to run multiline shell command within python Karim <kliateni@gmail.com> - 2013-01-10 15:25 +0100
  Re: [Tutor] How to run multiline shell command within python Matty Sarro <msarro@gmail.com> - 2013-01-10 10:21 -0500
  Re: [Tutor] How to run multiline shell command within python Karim <kliateni@gmail.com> - 2013-01-10 20:07 +0100

csiph-web