| Users Online : 1517 | Tuesday 06th of January 2009 | ![]() |
![]() |
|
|
|||||||||||
CBSE eBooks CBSE Guess > eBooks > Class XII > Informatics Practices By Agnelo Cursors
A cursor is a variable that can be used to access the result of a particular SQL query. Cursors can move sequentially from row to row (cf. file pointers in C). Every SQL query statement in PL/SQL has an implicit cursor. Cursors provide flexibility in processing rows of a query. Cursor loop variables are implicitly declared as the ROWTYPE for the SELECT result. The FETCH operation can also extract components of a row: Cursors have several built-in attributes:
Yet another method for cursor iteration: The CURRENT OF operator allows us to operate on the current tuple via SQL. Example: give low-paid workers a higher pay rise Cursor Example Consider the problem of buying football players to make up a team with the constraint of a "salary cap". We want to buy the best (most expensive) players first, but we have to stop taking them once we reach the salary cap. Assume we can then make up the rest of the team with "cheap" young players. DECLARE
|
|
About Us - Success Stories - Guest Book - RSS Feeds - Education Forum - Contact Us - Help - Links - Advertise With Us - Terms of Service - Privacy Policy
© 2003-2007, CBSE Guess.com Website Designing, Website Development, Search Engine Promotion, Web Hosting By: DreamzSop Advertising Private Limited. |
||||||||||||||||||||||||||||||