- 论坛徽章:
- 0
|
本帖最后由 maybenot 于 2017-06-17 18:36 编辑
- use lib '../lib';
- use Schema;
- my $schema = Schema->connection('dbi:SQLite:../test.db',
- '', '',
- { sqlite_unicode => 1} );
- my $rs = $schema->resultset('Type')->search({ name=> 'Lcs'});
- while( my $cd = $rs->next() ){
- $cd->set_column( score => 180 );
- $cd->update();
- }
复制代码 我想查找出一些记录,然后更新它们的score字段,上面的代码报错:
DBIx::Class::ResultSource::_pri_cols_or_die(): Operation requires a primary key
to be declared on 'Type' via set_primary_key at update_col.pl line 11
到底应该怎么写呢,谁给看下谢谢!
|
|