Archive for October 13th, 2008
SQL CURSOR – SQL For Programmers
One of the things it took me a while to figure out was how to get a stored procedure to loop through data in a table and pull out specific data I needed.
There are actually two parts to this question. First, you should always try to find some other way of doing whatever it is you think you need to do by processing one row at a time. SQL is a “Set-Based” language and as such it expects you to work with the whole set. That’s what it was designed to do best and that’s why it has functions such as MAX, MIN, SUM, AVG, etc. Many of these functions in combination with a good WHERE clause will get you the information you need.
However, there are times when you’ll need to process the information one record at a time, and this is what the CURSOR was created for.
Other Related Items:
Learning PHP, MySQL, and JavaScript: A Step-By-Step Guide to Creating Dynamic Websites (Animal Guide)If you know HTML, this guide will have you building interactive websites quickly. You'll learn how to create responsive, data-driven websites with PHP... Read More >
Port Authority - Medium Length Apron with Pouch Pockets (A510)Medium Length Apron with Pouch Pockets by Port Authority


