Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How I can get LAST_INSERT_ID after insert? #72

Open
tonespy opened this issue Sep 19, 2018 · 0 comments
Open

How I can get LAST_INSERT_ID after insert? #72

tonespy opened this issue Sep 19, 2018 · 0 comments

Comments

@tonespy
Copy link

tonespy commented Sep 19, 2018

#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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant