On Dec 2, 2007 1:51 PM, Zbigniew Lukasiak <[EMAIL PROTECTED]> wrote:
> Hi Jonas,
>
> On Nov 29, 2007 11:35 AM, Jonas Alves <[EMAIL PROTECTED]> wrote:
> > Hello all,
> >
> > I', triyng to call delete in a resultset with a join. like this:
> >
> >     $schema->resultset('Movie')->search(
> >         { 'category.update_flag' => 'old' },
> >         { join => 'category' }
> >     )->delete;
> >
> >
> > The SQL I'm getting is:
> >
> > DELETE FROM movie WHERE ( update_flag = ? ): 'old'
> >
> > And I was expecting something like:
> >
> > DELETE FROM movie LEFT JOIN category WHERE ( category.update_flag = ? ): 
> > 'old'
>
> Are you sure that is the right syntax?  The PostgreSQL tutorial
> suggest another form:
>
> DELETE FROM films USING producers
>   WHERE producer_id = producers.id AND producers.name = 'foo';
>
> http://www.postgresql.org/docs/8.3/static/sql-delete.html
>
> Cheers,
> Zbyszek
> http://perlalchemy.blogspot.com
>

Yes, probably that's the right syntax. However I think that mysql also
accepts a join.
But anyway, my point is that DBIC is not doing the right thing here.

Cheers,
-- 
Jonas

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to