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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ee0dc912649d50d4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit From: Brian May Newsgroups: comp.lang.ada Subject: Re: Ada DB bindings and APQ References: <1km3c584awura$.y7djkir1ozya$.dlg@40tude.net> Date: Thu, 16 Dec 2004 12:40:31 +1100 Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:5z5dBJFYvZhTaEGUeJMJFp8xOtg= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: snoopy.microcomaustralia.com.au X-Trace: news.melbourne.pipenetworks.com 1103161206 202.173.153.89 (16 Dec 2004 11:40:06 +1000) X-Complaints-To: abuse@pipenetworks.com X-Abuse-Info: Please forward all headers to enable your complaint to be properly processed. Path: g2news1.google.com!news3.google.com!news.glorb.com!newsfeed-east.nntpserver.com!nntpserver.com!news1.optus.net.au!optus!news.mel.connect.com.au!news-north.connect.com.au!news.alphalink.com.au!news.labyrinth.net.au!news.melbourne.pipenetworks.com!not-for-mail Xref: g2news1.google.com comp.lang.ada:6985 Date: 2004-12-16T12:40:31+11:00 List-Id: >>>>> "Brian" == Brian May writes: Brian> The documentation has an alternative loop structure: Brian> while not End_Of_Query(Q) loop Fetch(Q); ... end loop; I realized, despite the documentation, End_Of_Query is not currently supported on sequential connections, because it is not known if all tuples have been fetched until you try to fetch the next one past the end. This limitation could be overcome if the previous call to the "execute" or "fetch" called fetch in advance for the next row, and stored the results in a temporary holding point. You don't miss out on anything either, as all the rows will eventually have to be fetched anyway. This is better, IMHO, then requiring an exception be the terminating condition for a loop. An alternative would be to restructure the loop as: while true loop Fetch(Q); exit if No_More_Data(Q); ... end loop; I don't particular like this approach though, although it would work. -- Brian May