[Zope] Trigger/Auto ID on Gadfly DB
sean.upton@uniontrib.com
sean.upton@uniontrib.com
Tue, 05 Nov 2002 14:56:40 -0800
Um... just be careful. This won't scale to several simultaneous request=
s.
You might want to be concerned about duplicate keys, conflict errors, and
other such problems. Have you considered a random number and a check to =
see
if it is in the db?
Sean
-----Original Message-----
From: Miche=E1l Healy [mailto:michael.healy@engitech.ie]
Sent: Tuesday, November 05, 2002 8:23 AM
To: zope@zope.org
Subject: Re: [Zope] Trigger/Auto ID on Gadfly DB
Thanks - I guess I'll just do a select and increment the thing myself.
Sorry about the double post. for some reason, it took ages for the origi=
nal
one to appear on the list.
Miche=E1l
----- Original Message -----
From: "Matthew T. Kromer" <matt@zope.com>
To: "Miche=E1l Healy" <michael.healy@engitech.ie>
Cc: <zope@zope.org>
Sent: Tuesday, November 05, 2002 4:02 PM
Subject: Re: [Zope] Trigger/Auto ID on Gadfly DB
> Miche=E1l Healy wrote:
>
> > Hi all,
> >
> > Is it possible to set a trigger on a gadfly database table? I would
> > like to automatically generate an Id on a table each time I insert.
> > In Oracle, I would create a sequence and then create a trigger on the
> > table in question based on the sequence. I something similar possibl=
e
> > with Gadfly?
> >
> > TIA,
> >
> > Miche=E1l
>
>
> Erm.
>
> No.
>
> Gadfly is a very light-weight database. It accepts SQL commands, but i=
t
> isn't a "full" database like you might think.
>
> I dont know if it has automatic sequence numbers -- that's your real
> question. Each RDBMS tends to do automatic sequence number differently.
> Oracle actually does it the most awkward way, by requiring you to set =
a
> trigger on inserts. Most other RDBMS will let you specific an
> auto-increment column some way.
>
> Granted, I could be wrong about Gadfly -- I only spent about 90 seconds
> grepping the source for a likely auto-increment column operator. But I
> do not believe Gadfly does this for you.
>
> --
> Matt Kromer
> Zope Corporation http://www.zope.com/
>
_______________________________________________
Zope maillist - Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev )