From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,333d8690b2d403e5,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.227.230 with SMTP id sd6mr2180863pbc.8.1334846270109; Thu, 19 Apr 2012 07:37:50 -0700 (PDT) Path: r9ni74516pbh.0!nntp.google.com!news2.google.com!news1.google.com!news.glorb.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Date: Thu, 19 Apr 2012 16:37:49 +0200 From: =?ISO-8859-1?Q?Thomas_L=F8cke?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120403 Thunderbird/11.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: GNATCOLL.SQL.SQL_Select - I'm in Left_Join hell Message-ID: <4f90233d$0$282$14726298@news.sunsite.dk> Organization: SunSITE.dk - Supporting Open source NNTP-Posting-Host: 77.234.168.91 X-Trace: news.sunsite.dk DXC=7TB7_0IKc5BB^D;0lZCOUDYSB=nbEKnkKLjXPCMh]fEM3ZOKe3?:>XAcAE?;m5ccYC3>^Oo7SF Hey all, I'm hoping some GNATCOLL.SQL specialist can help me write a SQL_Select call that isn't as horribly ugly as the one I've currently come up with. The SQL query I'm frantically trying to create is this: https://gist.github.com/2421273 A fairly straightforward query with a bunch of JOIN's. Nothing overly complicated and very easy to read. Next lets take a look at the GNATCOLL.SQL.SQL_Select call I've come up with: https://gist.github.com/2421241 It is, IMHO, very unreadable with all those nested Left_Join calls. Is there a better/prettier way, without falling back to embedding an SQL string in the Ada source? The SQL generated by the above SQL_Select call works fine, it's just that I'm finding it very hard to read. Any and all suggestions are more than welcome! :o) -- Thomas L�cke | thomas@12boo.net | http://12boo.net