Welcome to EZDefinition.com
Technological Concepts, Abbreviations & Definitions
Main Menu
Main categories
  • Operating Systems
  • Computer Hardware
  • Internet
  • Programming Languages
  • Multimedia
  • Software
  • Security and Encryption
  • Communications and Networking
  • Organizations
  • Books
  • Databases
  • Games
  • E-commerce

    [an error occurred while processing this directive]

  • EZDefinition Sponsor
    Please visit our sponsor Parosoft.com
    Related Links to How to Get the Value of an AUTO_INCREMENT Column in ODBC
    [an error occurred while processing this directive]
    How to Get the Value of an AUTO_INCREMENT Column in ODBC
    [an error occurred while processing this directive]
    Computer Technologies  Databases  MySQL How to Get the Value of an AUTO_INCREMENT Column in ODBC

    How to Get the Value of an AUTO_INCREMENT Column in ODBC

    How to Get the Value of an AUTO_INCREMENT Column in ODBC

    A common problem is how to get the value of an automatically generated ID from an INSERT. With ODBC, you can do something like this (assuming that auto is an AUTO_INCREMENT field):
    INSERT INTO foo (auto,text) VALUES(NULL,'text');
    SELECT LAST_INSERT_ID();
    Or, if you are just going to insert the ID into another table, you can do this:
    INSERT INTO foo (auto,text) VALUES(NULL,'text');
    INSERT INTO foo2 (id,text) VALUES(LAST_INSERT_ID(),'text'
    For the benefit of some ODBC applications (at least Delphi and Access), the following query can be used to find a newly inserted row:
    SELECT * FROM tbl_name WHERE auto IS NULL;


    [an error occurred while processing this directive]

    [an error occurred while processing this directive]
     

    All Rights Reserved

    Terms of usage   Please read our privacy stetment
    Copyright © 1999-2006 EZDefinition.com

     

    [an error occurred while processing this directive]