By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,548 Members | 1,402 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,548 IT Pros & Developers. It's quick & easy.

db paramstyle for arrays

P: n/a

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.

Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.