1

I got an Postgres function with sth. like that:

INSERT INTO people.person (name, middlename, stat,city,tel [.....] )
VALUES ($2,$3,$4,$5,$6,$7, [.....] ,$25,$26,$27,$28,$29,$30,$31)

Is there a way, I can use sth. like VALUES ($2-$31)? Couldn't find anything here: http://www.postgresql.org/docs/8.2/static/sql-insert.html.

4

1 回答 1

0

I used the solution from contradictioned, which works fine for me:

'..VALUES ($' + join([2..31], ',$') + ')'
于 2013-10-15T09:09:20.197 回答