in reply to Re: SQL statment to insert if none exits and to obtain the primary key of a record with one visit!
in thread SQL statment to insert if none exits and to obtain the primary key of a record with one visit!

Agreed. This is not a perl issue at all. The solution lies with how Access works.

One dbms vendor neutral solution would be to:

  1. begin tran
  2. insert row
  3. if error due to duplicate key, then update if desired.
  4. commit or abort tran

I mean, there are definitely ways to do this that are vendor neutral, but in some cases the vendor DBMS (MS Access) have better solutions. I don't know about Access other than the basics.

Jason L. Froebe

Team Sybase member

No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

  • Comment on Re^2: SQL statment to insert if none exits and to obtain the primary key of a record with one visit!