Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 784589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:44:13+00:00 2026-05-14T20:44:13+00:00

I have a table with an auto-incrementing ID. After inserting a new row, I

  • 0

I have a table with an auto-incrementing ID. After inserting a new row, I would like to retrieve the new ID.

I found an article that used the MySQL function LAST_INSERT_ID(). The article says to create a new query and submit it.

I’m using MySQL Connector C++, Windows XP and Vista, and Visual Studio 9.

Here are my questions:

  1. Is there an API, for the connector,
    that will fetch the ID out of the
    record?
  2. Does the result set, after an
    insert/append, contain the new ID?
  3. The LAST_INSERT_ID is MySQL
    specific. Is there an SQL
    standard method for obtaining the new ID?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T20:44:13+00:00Added an answer on May 14, 2026 at 8:44 pm
    1. It doesn’t look like it – in the C API, you have mysql_insert_id() for this, but it doesn’t appear to be used in the C++ connector, nor does it appear to implement the getGeneratedKeys method from the JDBC API (However, I don’t use this connector myself, so I may be missing something obvious…).
    2. No, there is no result set from an INSERT.
    3. No. Supposedly, DB2 is the only one that follows what the SQL standard says about auto-generated keys; everyone else does it differently (from both the standard and from each other).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a T-SQL table variable (not a table) which has an auto incrementing
I'm working on databases that have moving tables auto-generated by some obscure tools. By
I have table with 50 entries (users with such details like Name Surname Location
Imagine I have table like this: id:Product:shop_id 1:Basketball:41 2:Football:41 3:Rocket:45 4:Car:86 5:Plane:86 Now, this
I have a table with more than a millon rows. This table is used
I have the following table in MySQL (version 5): id int(10) UNSIGNED No auto_increment
I have a number of tables that use the trigger/sequence column to simulate auto_increment
I have table inside a div tab. The table has 40 rows in it
I have table rows of data in html being filled from a CGI application.
While trying to use LINQ to SQL I encountered several problems. I have table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.