Retrieve Autoincrement Field Value Using ODBC?

Retrieve Autoincrement Field Value Using ODBC?

Post by Tecmo Ki » Fri, 14 Jun 1996 04:00:00




> I'm trying to retrieve the autoincrement field value on an insert  
> using SQL 6.0 and ODBC.  Is it possible without re-reading the record.
> Can I use an OBDC function like SQLSpecialColumns() or ???


        is how I do it.

        CREATE PROCEDURE TestIns
        (
                INSERT blah blah blah


        )

        brant
        ...

 
 
 

Retrieve Autoincrement Field Value Using ODBC?

Post by Tony Keit » Fri, 14 Jun 1996 04:00:00


I'm trying to retrieve the autoincrement field value on an insert using SQL
6.0 and ODBC.  Is it possible without re-reading the record.
Can I use an OBDC function like SQLSpecialColumns() or ???

Thanks
Tony
|-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-|
| Keith Consulting Services   Tony L. Keith     |
|                                               |
|  o Real-Time Automation   o Process Control   |
|  o Warehouse Management   o Inventory Control |
|  o RF Data Collection     o Communications    |
|                                               |
|  8711 Reading Road, Cincinnati, Ohio 45215    |
|  TEL: (513) 761-1234  FAX: (513) 761-5678     |

|-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-|

 
 
 

1. Retrieve value of autoincrement field with inserted record

Hello there,

I have a question...
This has been put on this NewsGroup earlier today but since I don't see it
appear (4 hours later) and this is my first try of using a newsgroup, I
must assume I did something wrong(?)...

When inserting a record in a table with an autoincrement field (the
primary key), either by a TTable or TQuery, how can you retrieve the value
of this field?
Using: Delphi 2.0, with DB's: Paradox, InterBase and Sybase (XI)... all
"behave" the same in this respect.

I want to implement a master-detail relation. When a record is inserted in
the master and details are added, I want to be able to cancel the whole
transaction, details and master. To insert the details I need the number
of the master.

Any help is greatly appreciated,

2. Replication error

3. How to get the value of a counter (AutoIncrement) field using MFC DAO classes

4. odbc

5. ODBC New Records using AutoIncrement Fields

6. converting .t00 files from unix to vms format

7. jdbc - retrieve value of autoincrement-primary key

8. Userinterface on Ingres

9. Retrieving values of AUTOINCREMENT columns

10. Problems retrieving informix value fields through ODBC

11. AddNew, Update, and then retrieving Autoincrement Field

12. Retrieving field descriptions using ODBC and VC++