ozzo-dbx icon indicating copy to clipboard operation
ozzo-dbx copied to clipboard

How I can get LAST_INSERT_ID after insert?

Open tonespy opened this issue 7 years ago • 0 comments

#64

Revisiting this question in the issue above, How can I return the ID of a new record after being created using data manipulation queries as explained here

I am using postgres. Insert into table using the data manipulation query. Tried using:

		insertedID, err := result.LastInsertId()
		fmt.Println("Created User Result: ", result)
		fmt.Println("Created User Insert ID: ", insertedID)
		fmt.Println("Created User Error: ", err)

But, it came back with this Created User Error: no LastInsertId available

tonespy avatar Sep 19 '18 08:09 tonespy