develooper Front page | perl.dbi.users | Postings from February 2001

Re: using sequences in DBIx::Recordset

Thread Previous
From:
Gerald Richter
Date:
February 14, 2001 05:35
Subject:
Re: using sequences in DBIx::Recordset
Message ID:
004701c0968b$2379a890$0b0b0b0a@i.ecos.de
>
> I'm using the following code (the $dsn has been set before):
> %sqlquery = (
>     '!Table'            => 'servicetransactions',
>     '!Serial'           => 'ServiceTransactionID',
>     '!Sequence'     => 'ServiceTransactionIDSequence',
>     '!Fields'       => 'ServiceTransactionID, IntervalBegin, IntervalEnd',
>     'IntervalBegin' => $IntervalBegin,
>     'IntervalEnd'       => $IntervalEnd
> );
>
> *set = DBIx::Recordset -> Insert ({%sqlquery});
>

The follwoing call will return the serial of the last insert.

$x = $set -> LastSerial ;

You should also find this in the DBIx::Recordset docs. If the docs are
unclear let me know, so we can make them better

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About