[DB-SIG] db paramstyle for arrays
Lee Harr
missive at hotmail.com
Mon Apr 5 16:56:19 EDT 2004
Is there a special DB API style for inserting array values in
to a database?
In postgres, the values needs to end up like ARRAY[1, 2, 3]
so I am just putting the word ARRAY in to the query string
like this:
q = "INSERT INTO foo VALUES (ARRAY%(bar)s)" % {'bar': [1, 2, 3]}
That works, but it seems to me there may be a better way.
Thanks for your time.
_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=features/junkmail
More information about the DB-SIG
mailing list