yes...that was my error... forgot ..'cause I modified the table and forgot
to specify auto_increment....;)
thanx
PS.
One thing may be not so important... is it possible so that we have a alias
to ->resultset() it is too long, especialy when u chain
several calls it eats up all the space ;)) ....... i.e. ->rs()
As we talk about aliases, what about ;) :
$schema->from($table)->select(\%where);
|---------+---------------------------->
| | Matt S Trout |
| | <[EMAIL PROTECTED]|
| | .me.uk> |
| | |
| | 11/10/2006 12:47 |
| | AM |
| | Please respond to|
| | dbix-class |
| | |
|---------+---------------------------->
>--------------------------------------------------------------------------------------------------------------------|
|
|
| To: [email protected]
|
| cc:
|
| Subject: Re: [Dbix-class] Can't get last insert id ?!
|
>--------------------------------------------------------------------------------------------------------------------|
[EMAIL PROTECTED] wrote:
> here is the code :
> $schema->resultset('tableX')->create(\%record);
>
>
> here is dump of the %record :
> $VAR1 = {
> 'field6' => '1',
> 'field5' => 'PP ',
> 'field1' => '00000000000011716438',
> 'field2' => 0,
> 'field3' => '0000001',
> 'field4' => '102737 '
> };
>
> and here is what i see when run the script like this :
> # DBIC_TRACE=1 ./loader.pl
>
>
> INSERT INTO tableX (field1, field2, field3, field4, field5, field6)
VALUES
> (?, ?, ?, ?, ?, ?): '00000000000011716438', '0', '0000001', '102737
> ', 'PP ', '1'
> DBIx::Class::ResultSet::create(): Can't get last insert id at
> /path/to/Loader.pm line 114
You didn't pass a PK and mysql's not letting you get the inserted id back -
is
the PK marked AUTO_INCREMENT?
--
******************************************************************************
This communication (including any attachments) may contain privileged or
confidential information intended for a specific individual and purpose,
and is protected by law. If you are not the intended recipient, you should
delete this communication and/or shred the materials and any attachments and
are hereby notified that any disclosure, copying, or distribution of this
communication, or the taking of any action based on it, is strictly prohibited.
Thank you.
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/