[sf-perl] Going from XML to SQL

Shane Hill shanehill00 at gmail.com
Fri Apr 1 09:50:20 PST 2005


yup, that was one of the ways I contemplated doing this. But you are
hosed if  Pg starts auto naming things differently.  I am going to try
several things and see what I like best.  I will let the list know
what I come up with.

-Shane

On Apr 1, 2005 9:45 AM, Matthew Albright <mattalbright at yahoo.com> wrote:
> We're on 7.x here, and we use:
> 
> select currval($tablename . '_id_seq')
> 
> We can do this because all of our tables are created through one
> interface, and they always have a column: "id serial primary
> key".
> 
> And of course the above sql statement is abstracted behind a
> method that's called "get_last_insert_id", and that method
> checks that you're in a transaction at the time, and dies if it
> isn't.
> 
> If we ever upgrade to 8.x it could probably be changed, but it's
> only in one place so it would be trivial.
> 
> matt
> 
> 
> --- David Wheeler <david at kineticode.com> wrote:
> > On Mar 31, 2005, at 5:59 PM, Shane Hill wrote:
> >
> > > my $id =
> > >
> >
> $self->connection->last_insert_id(undef,undef,$table_name,undef);
> > > $table_name is defined and assigned.
> > >
> > > the docs say this is ok,  how am I screwing up?
> >
> > How is the ID generated? What does your ID column declaration
> > look
> > like? Do you use a sequence?
> >
> > Regards,
> >
> > David
> >
> > _______________________________________________
> > SanFrancisco-pm mailing list
> > SanFrancisco-pm at pm.org
> > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
> >
> _______________________________________________
> SanFrancisco-pm mailing list
> SanFrancisco-pm at pm.org
> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
>


More information about the SanFrancisco-pm mailing list