[CDBI] Re: Class::DBI internal column swapping wierdness ? - possible resolution! (UNION DISTINCT)?

[prev] [thread] [next] [Date index for 2005/10/06]

From: Edward J. Sabol
Subject: [CDBI] Re: Class::DBI internal column swapping wierdness ? - possible resolution! (UNION DISTINCT)?
Date: 20:31 on 06 Oct 2005
> I think you'll find the query is a bit of a red-herring, the critical bit, as 
> far as I can tell, is the UNION DISTINCT, as described above.  I could be 
> wrong of course, it's only a theory :-)

Personally, I suspect the part that comes immediately after the "UNION
DISTINCT", namely the "SELECT * from task". For the SQL to be compatible with
the part provided by CDBI, it should be "SELECT __ESSENTIAL__ FROM
__TABLE__".

So try this instead:

        my $sql = qq|name IN (
                       SELECT name FROM task where shared = 'NO' AND
                                                   application = '$application'
                     UNION DISTINCT
                   SELECT __ESSENTIAL__ FROM __TABLE__
                          where shared = 'YES' AND application IN (
                          SELECT name FROM application WHERE container =
                          '$container')|;

It would be an interesting thing to try anyway. Let us know if that solves
your problem or not?

Hope this helps,
Ed

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] Re: Class::DBI internal column swapping wierdness ? - possible resolution! (UNION DISTINCT)?
Edward J. Sabol 20:31 on 06 Oct 2005

Generated at 10:29 on 10 Oct 2005 by mariachi v0.52