Database Programming

Aahz Maruch aahz at
Tue May 2 20:28:01 EDT 2000

In article <#UCgPEJt$GA.230 at cpmsnbbsa03>,
lexberezhny <lexberezhny at> wrote:
>  You can use the 'for' loop:
>for item in table:
>    database.query('INSERT INTO format_prices
>(time,open,high,low,close,volume) VALUES

A better variation on that theme:

for item in table:
  item = tuple(item)
    INSERT INTO format_prices
    (time, open, high, low, close, volume)
    VALUES ( '%s', '%s', '%s', '%s', '%s', '%s' )
    """ % item)
                      --- Aahz (Copyright 2000 by aahz at

Androgynous poly kinky vanilla queer het    <*>
Hugs and backrubs -- I break Rule 6

"Laws that restrict speech are an abomination for a simple reason.
They're like a poison gas; they seem to be a good weapon to vanquish
your enemy, but the wind has a way of shifting."  -- Ira Glasser

More information about the Python-list mailing list