I've done this with one of my apps, and it works pretty well. Beware of using any derived fields in your views though (like SUM(total)) - the mysql PHP drivers have a bug in them that prevents the correct field names from being seen by cakePHP for these fields.
The one reason not to do the would be if wanted to be able to update related tables - at least in MySQL there are no updateable views. On Feb 4, 12:13 pm, Defranco <[EMAIL PROTECTED]> wrote: > Hi all, > > Is acceptable to use a sql view table (a virtual sql table based on > predefined permanent queries) instead a using a controller logic for a > specific case? > > I have a complex query between several tables and looks like that > would be too hard to do it using models relations and controller logic > and looks easy to just create a sql view and attach it a model like > it is a table. > > is just for one specific case - is this a dirty solution? Should I > try to do it using model relations plus controller logic instead? Is > there a disadvantage of doing this? > > thanks > > /Erico --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---