max / sap DB getting the primary key from an insert DBD::ODBC

From: xander (xander_steele_at_yahoo.com)
Date: 01/30/04


Date: 30 Jan 2004 09:01:08 -0800

How would I use perl DBI to get the primary key, a maxdb 'sequence'
field from my table on insert. I need an accurate key value returned
to set up a number of 1:M foreign key table relationships immediately
after the initial insert.

I dont want to do something like 'select max(serial_field)' as
potentially thousands of users may be inserting records at the same
time. I need confidence that the key is applicable to a specific
$sth->execute.

regards



Relevant Pages

  • Re: problem using identity column as primary key
    ... >> I am thinking of creating an identity column to use it as primary key ... More and more programmers who have absolutely no database training are ... the gap in the sequence is not filled in and the sequence ... vin CHARNOT NULL REFERENCES Motorpool); ...
    (microsoft.public.sqlserver.programming)
  • Re: Doubling the order
    ... Other than the orderId, there is nothing to say that two orders are the ... > 1.PRODUCTID) - primary Key ... >> relational database and it is not the best one. ... the gap in the sequence is not filled in and the sequence ...
    (microsoft.public.sqlserver.programming)
  • Re: Indexes and primary keys, from Delaney
    ... bloat all nonclustered indexes and the likelihood of page splitting. ... If you have a clustered index on SSN,ACCOUNT,DATE, SEQUENCE ... > and account number, ... > I originally had all four fields as a composite primary key. ...
    (microsoft.public.sqlserver.programming)
  • Re: Doubling the order
    ... 1.PRODUCTID) - primary Key ... > data model or any data integrity. ... the gap in the sequence is not filled in and the sequence ... > Since a query result is a table, and a table is a set which has no ...
    (microsoft.public.sqlserver.programming)
  • Indexes and primary keys, from Delaney
    ... consists of the SSN, account number, transaction date, and a sequence ... claim that the sequence number is unique and never reused. ... and account number, ... I originally had all four fields as a composite primary key. ...
    (microsoft.public.sqlserver.programming)