1 ## Removed from UPDATE.pod:
3 =head2 Update a row based on data in other tables
5 -- Slightly less pointless example
7 SET title = user.username || title
8 JOIN users user ON user.id = posts.user_id;
10 Joining two tables for an update is a similar sort of exercise to
11 joining them for a select query and using data from both.
15 =item 1. Create a Schema object representing the database you are working with:
17 my $schema = MyDatabase::Schema->connect('dbi:SQLite:my.db');
19 =item 2. Call the B<search> method on the resultset for the L<ResultSource|DBIx::Class::ResultSource> you wish to update data in, joining to the second table:
21 my $posts = $schema->resultset('Post')->search(
26 The B<join> key takes as an argument a nested structure of one or more relation names (see L<DBIx::Class::Manual::SQLHackers::CREATE>).
28 =item 3. Call the B<update> method on the resultset to run the UPDATE statement:
30 $posts->update({ 'me.title' => \[ 'user.username || me.title' ] });
32 ^^ I am 95% sure this won't actually work, please try it (ideally as a passing or failing test)