Skip to Main Content
SQL All-in-One For Dummies, 4th Edition
book

SQL All-in-One For Dummies, 4th Edition

by Allen G. Taylor, Richard Blum
April 2024
Intermediate to advanced content levelIntermediate to advanced
800 pages
18h 34m
English
For Dummies
Content preview from SQL All-in-One For Dummies, 4th Edition

Chapter 5

Cursors

IN THIS CHAPTER

Bullet Declaring a cursor

Bullet Opening a cursor

Bullet Fetching data from a single row

Bullet Closing a cursor

SQL differs from most other computer languages in one important respect: Other languages, such as C, Java, or Basic, are procedural languages because programs written in those languages set out a specified series of operations that need to be carried out in the same manner and in the same order — procedures, in other words. That means procedural languages first execute one instruction, and then the next one, then the next, and so on. The pertinent point here is that they can do only one thing at a time, so that when they are asked to deal with data, they operate on one table row at a time. SQL is a nonprocedural language, and thus is not restricted to operating on a single table row at a time. Its natural mode of operation is to operate on a set of rows. For example, an SQL query may return 42 rows from a database containing thousands of rows. That operation is performed by a single SQL SELECT statement.

Because SQL is a data sublanguage, it does not contain all ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SQL All-In-One For Dummies, 3rd Edition

SQL All-In-One For Dummies, 3rd Edition

Allen G. Taylor
SQL Essentials For Dummies

SQL Essentials For Dummies

Richard Blum, Allen G. Taylor
SQL in a Nutshell, 4th Edition

SQL in a Nutshell, 4th Edition

Kevin Kline, Regina O. Obe, Leo S. Hsu

Publisher Resources

ISBN: 9781394242290Purchase Link