in reply to Re: MySQL, DBIx::Recordset and is there a better way?
in thread MySQL, DBIx::Recordset and is there a better way?

Thanks for the help. That line was indeed what I was hoping for.

I actually would like to learn more about SPOPS which has been mentioned in response to my posts more than once. However, in this case, MySQL has an auto-increment on the primary key which I have set.

HOWEVER, I do see the advantage of having the code do the autoincrement because then you don't have to rely on the db or the dba to do it for you.

  • Comment on Re: Re: MySQL, DBIx::Recordset and is there a better way?

Replies are listed 'Best First'.
SPOPS and auto-incrementing
by lachoy (Parson) on Jan 03, 2002 at 07:42 UTC

    SPOPS still relies on the database to do the auto-incrementing for you, it just provides a consistent interface on how to retrieve the incremented value.

    IME, database-generated index fields break down cleanly into two types: those that expect you to trigger something before the INSERT so you can get the incremented value, and those that create a unique value and make it available after the INSERT. Oracle, PostgreSQL, mSQL and other databases that use sequences fall in the first category -- even if you embed the sequence select in the INSERT. In the second category we have Transact-SQL databases (Sybase ASA/ASE, Microsoft SQL) and MySQL.

    So all SPOPS does is ask you to tell it if you're using an auto-increment field and tell it what type of database you're using. It's generally smart enough to figure out the rest.

    And that was probably me bringing up SPOPS those times you saw it. One of my resolutions is to become an annoying tubthumper for my work and get other people interested enough to contribute :-)

    Chris
    M-x auto-bs-mode