Beginner's SQL: Loop The Output

10504 Users read it.
by Rudy Limeback
In this second article in the new Beginner's SQL series, a common performance problem is solved. When a database-driven Web page runs a query to retrieve some data, and then uses a value from each row in the result to run an additional query, this "query in a loop" requires excessive and unnecessary database overhead. More importantly, the total time to complete the database retrievals, and thus the resulting Web page download time, balloons. In this article, four examples are shown which "loop the output" and not the query: simple lists, header/detail listings, row differences, and subtotals.

User Rating (3 votes)
For multiple purchases and discounts contact us
$3.39 USD Live Support Support Forum

User Level:Beginner
Product:Dreamweaver MX, UltraDev 1, FireWorks MX
Server Model:ASP JavaScript, ASP VBScript, ASP.NET C#, ASP.NET VB, ColdFusion (UD4), ColdFusion (DWMX), JSP, PHP ImpAkt 1(UD4), PHP MySQL (DWMX), PHP PHAkt 1 (UD4)
Number Of Pages:12

Rudy Limeback

Rudy LimebackRudy Limeback is an independent consultant with over 20 years of SQL experience using DB2, SQL Server, Access, Oracle, and MySQL. Rudy is also a Web developer, Technical Editor at Digital Web, one of the original evolt.org admins, with his own Web site since 1996. More information at r937.com. Rudy lives in Toronto, Canada, where the weather allows you to play frisbee golf all year long.

See All Postings From Rudy Limeback >>

Follow us on twitter Subscribe to our RSS feed
Activate your free membership today | Login | Currency