-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Milestone
Description
do we care that you have to use different wild cards depending on the back end? ---------- Forwarded message ---------- From: zeroc8 <arnold.angerer@zeroc8.com> Date: Tue, May 8, 2012 at 2:03 PM Subject: [go-nuts] Re: Postgres pq - LastInsertId To: golang-nuts@googlegroups.com Am Dienstag, 8. Mai 2012 11:19:13 UTC+2 schrieb Alexander Neumann: > > Try something like this (untested): > > err := db.QueryRow("INSERT INTO foo (bar) VALUES ($1) RETURNING id;", > bar).Scan(&id) > > Thanks, works. err := tx.QueryRow("insert into car(name) values($1) returning id","test").Scan(&id)