On 5 February 2012 03:29, Rajeev Prasad <rp.ne...@yahoo.com> wrote: > > > Author says: > > Adding and removing rows > To create a new record in the database, you can use the create method. It > returns an instance of My::Schema::Result::Album that can be used to access > the data in the new record: > > my $new_album = $schema->resultset('Album')->create({ title => 'Wish You Were > Here', artist => 'Pink Floyd' }); > > > Now you can add data to the new record: > > $new_album->label('Capitol'); $new_album->year('1975'); $new_album->update; > > But the tables album has only three columns which are: "album" table with > three columns: "albumid", "artist", and "title" > > so what does year and label stand for? sorry i am confused. do i have to run > update after running create? >
I think your right. It is confusing. At a guess, I would say label and year are relations/accessors to other tables. If that were the case, your album table class would define accessors to another tables that has attributes label and year. Perhaps a better place to start with DBIx::Class is the example[1]. Also it is worth pointing out that there is a specific mail list for DBIx::Class [2]. I should also point out that the DBIx mailing list is not a list for asking about perl beginners questions. There is an expectation that you will have read the documentation and have an understanding of OO perl. Having said that, they are always keen to make their documentation clear and I think you have found an paragraph that could use some revision. HTH, Dp. 1) http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/Example.pod 2) http://lists.scsys.co.uk/mailman/listinfo/dbix-class -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/