Thank you,
Yes, I mean I'm using DBIC. I've tried your method. It did not give error,
but, also did not insert into the table.
Do I miss something?
Jonathan Rockway <[EMAIL PROTECTED]> wrote: Will Smith wrote:
> Hi,
> Could someone please show me the syntax to create multiple records. For
> example my table book has 3 fields : id (auto_increment), title, price.
> On the template I have 3 rows of title/price. I want to enter 3 book
> titles and prices and create at the same time.
> With the old syntax, I can do something like
> my $book = myapp::M::CDBI::Book::Shift->create(\%hash);
Are you really using CDBI? If so, switch to DBIC and do:
push @records, {title => "foo", price => "13.37"};
# same thing a few more times...
eval {
$c->model('BookDB::Books')->create($_) for (@records);
}
die "Error: $@" if($@);
or something similar.
--
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com _______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/