MySQL Forums
Forum List  »  Connector/Node.js

Re: SqlResult does not have getLastInsertId()
Posted by: Rui Quelhas
Date: January 25, 2023 09:25AM

Hi Seongjoo Lee,

you are right. The user guide is outdated with regards to the result set API (I'll try to get it fixed).

In the scope of an SQL statement result set, the "id" is basically the value of an PRIMARY KEY AUTO INCREMENT column, if there is one.

So, there is a "getAutoIncrementValue()" (https://dev.mysql.com/doc/dev/connector-nodejs/8.0/module-SqlResult.html#getAutoIncrementValue__anchor), which returns just that value.

Hope it helps.

Thanks

Options: ReplyQuote


Subject
Written By
Posted
Re: SqlResult does not have getLastInsertId()
January 25, 2023 09:25AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.