phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] proposal-branch; porting


From: Chris Weiss
Subject: Re: [Phpgroupware-developers] proposal-branch; porting
Date: Fri, 07 May 2004 02:22:56 +0000

i'm not sure I understand this whole sequence thing.  it seems like a hack for
the guarreented, and rather simple, way to get an ID of inserting a row into a
table with auto_inc and calling a function get the last ID made by the
connection.

Joseph Engo (address@hidden) wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Just a follow up on this, I did some research on how ADODB handles
> sequences / last insert ID number for cross database support.
> - - For MySQL, it will create a table named <sequence_id_name> and
> update that when you request the next id number.
> ~  This also holds true for any databases which don't support native
> sequences.
> - - PostgreSQL will keep using its build in sequence support.  It will
> just do a nextval('<sequence_id_name>')
>
> Keep in mind, you *must* request an ID number *before* you do your
> insert.  At that time, you must specify the new
> ID number in your insert.
>
> I don't like how it creates a seperate table for each sequence, it
> really clutters things up.  I would prefear to create
> a generic single table to handle all of these.  However, I want to
> wait until more databases are tested to make sure its
> all going to fit together.  Presently, you must specify the PostgreSQL
> generated sequence name.  I want to develop
> our own naming conventions for this, kind of like what schemaproc
> does.  This will need to be changed in ADODB,
> I am going to contact that developers of the AXMLS and ADODB to have
> this added in a future release.  I want to make
> as little, if any changes to there code.  Make sure its up to date.
>
> If anyone is porting or working on apps for the new framework, please
> follow the above method.  Once you come up with
> some standard names, it won't be hard to make changes.
>
> Joseph Engo wrote:
>
> | Dan Kuykendall wrote:
> |
> | | Joseph Engo wrote: | |> -----BEGIN PGP SIGNED MESSAGE----- Hash:
> | SHA1 |> |> | $GLOBALS['phpgw']->db->get_last_insert_id() | This is
> | something |> I need to add.  Its very easy to do for PostgreSQL,
> | but MySQL is |> more of a pain.  For now, I am just doing a select
> | after I add |> the record.  Which will be fixed later once
> | get_last_insert_id() |> is ported.  AdoDB doesn't, from what I
> | understand have something |> like this, or its something they
> | removed over time for whatever |> reason. | | | Why do you think it
> | was removed? | |
> | http://phplens.com/lens/adodb/docs-adodb.htm#inserted_id
> |
> |
> | "PostgreSQL returns the OID, which can change on a database
> | reload." - The OID number is useless to an app developer, it
> | doesn't return the last insert ID like you think it would.  The OID
> | number is a unique number for every insert and update, which can be
> | later referenced to an action.
> |
> |
>
> _______________________________________________
> Phpgroupware-developers mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/phpgroupware-developers
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.3 (MingW32)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>
> iD8DBQFAmtb5/AzmiD/o0voRAvSkAJ9vbCIQuJ3df622BXbdX11sh0lOOwCfTCjG
> Os4Fl3zr9XBb2t+ctGBDgnk=
> =4m58
> -----END PGP SIGNATURE-----
>
>
>
> _______________________________________________
> Phpgroupware-developers mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/phpgroupware-developers
>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]