[Catalyst] Create multiple records

Will Smith willbelair at yahoo.com
Tue Jan 2 15:54:29 GMT 2007


happy new year to all of you.
 
 thanks all for your support. Back to the question, (which I guess, will irritate some catalyst/perl gurus - but please be patient for learners), I've been able to add multiple records with "PRE" assigned values. But that's not my purpose. I need to add multiple rows that have the same name on the html. I tried several ways, but none was good.
 
 my $book;
 my $record; 
 foreach $book ( @{$c->request->params->{book}}){
   
     push  @records, {title => $book, price => $price };
     };
    
        eval{
           $c->model('bookDB::Book')->create($_) foreach (@records);
        };

 ---- this gives me the compling error: Global symbol "@records" requires explicit package name
 
Juan Miguel Paredes <juan.paredes at gmail.com> wrote: On 12/29/06, Will Smith  wrote:
> 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?
>

Hi, Will!

Are the correct SQL statements being generated? (try export
DBI_TRACE=1 or something like that)

Is a COMMIT missing? (check AutoCommit on your dsn and/or DBD::*
database specific docs, e.g. for PostgreSQL/Oracle it is off by
default, IIRC)

Greetings!

_______________________________________________
List: Catalyst at lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
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 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070102/0de1ae97/attachment.htm


More information about the Catalyst mailing list