Perrin Harkins wrote:
On Mon, 2006-04-03 at 00:38 +0300, Giannis Economou wrote:
The id is a nice way to go, but what can someone do if we are talking
about new records that get their ids from the database and C:DBI's
create() method does not create any id until the database provides it.
Class::DBI's crate() method immediately inserts the row and gets an ID.
It is not possible to have a Class::DBI object without an ID.
- Perrin
It is possible to have a Class::DBI object without an id, before the
insert really takes place. From Class::DBI perldoc:
The |before_create| trigger is invoked directly after storing the
supplied values into the new object and before inserting the record into
the database. The object stored in $self may not have all the
functionality of the final object after_creation, particularly if the
database is going to be providing the primary key value.
Giannis
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]