MySQL 8.4 C API Developer Guide / ... / C API Prepared Statement Interface / C API Prepared Statement Function Descriptions / mysql_stmt_insert_id()
uint64_tmysql_stmt_insert_id(MYSQL_STMT *stmt) Returns the value generated for anAUTO_INCREMENT column by the preparedINSERT orUPDATE statement. Use this function after you have executed a preparedINSERT statement on a table which contains anAUTO_INCREMENT field.
SeeSection 5.4.42, “mysql_insert_id()”, for more information.
Value forAUTO_INCREMENT column which was automatically generated or explicitly set during execution of prepared statement, or value generated byLAST_INSERT_ID( function. Return value is undefined if statement does not setexpr)AUTO_INCREMENT value.