GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Mainframe  >  DB2
Go To First  |  Previous Question  |  Next Question 
 DB2  |  Question 16 of 195    Print  
What is a cursor and what is its function?
An embedded sql statement may return a number of rows while the programming language can only access one row at a time. The programming device called a cursor controls the position of the row.


  
Total Answers and Comments: 2 Last Update: November 09, 2006   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
May 01, 2006 18:25:55   #1  
Shakil Member Since: April 2006   Contribution: 3    

RE: What is a cursor and what is its function?

I would like to make it very clear, for all my other my friends, who come to visit this Web side, that CURSOR is not a device( like any other computer Part), it is a small file, which can be open,read, and close like any other files, but the terminology is used as FATCH Instead of read.

Shakil Aslam.      


 
Is this answer useful? Yes | No
November 09, 2006 06:55:56   #2  
SHANKER        

RE: What is a cursor and what is its function?

hi friends,

             In DB2 actually we use CURSOR when there are more than one row to be fetched in a SELECT statement.


 
Is this answer useful? Yes | No

 Related Questions

An embedded sql statement may return a number of rows while the programming language can only access one row at a time. The programming device called a cursor controls the position of the row.  
Latest Answer : hi friends,             In DB2 actually we use CURSOR when there are more than one row to be fetched in a SELECT statement. ...

The three data types are DATE, TIME and TIMESTAMP. CHAR can be used to specify the format of each type. The DAYS function calculates the number of days between two dates. (It's Y2K compliant). 
Latest Answer : DATE PIC X(10)TIME PIC X(8)TIMESTAMP PIC X(26) ...

SQL statements may return any number of rows, but most host languages deal with one row at a time by declaring a cursor that presents each row at a unique isolation level.  

Cursor stability means that DB2 takes a lock on the page the cursor is accessing and releases the lock when the cursor moves to another page.  
Latest Answer : Cursor stability  isolation level ensures that any row that was changed by an application process cannot be read untill committed by that process. It ensures that the current row of every updatable cursor is not changed by other application process. ...

The clause avoids closing the cursor and repositioning it to the last row processed when the cursor is reopened.  
Latest Answer : To explain it let us take an example....Suppose we have a query that updates a table once the task is complete the table gets updated(commit), and all the relevant resources acquired by the task is released..With hold option does not release the resouces ...

This is a key concept for any relational database. Isolation level is the manner in which locks are applied and released during a transaction. For DB@ a 'repeatable read' holds all locks untile 
Latest Answer : Isolation level means the extent to which the transaction isolates the data is accessed ...

Latest Answer : Cursor stands to the first record sorted by the field given in order by clause of cursor declaration. ...

Latest Answer : You will declare the Cursor with "WITH HOLD " Option when you want the cursor to be pointing to the next row even after the fetch from the db2 table and you exit from the program until expilicit commit is performed to updated to Db2 and Close cursor ...

Latest Answer : Char function returns a character format of date or time. ...
Read Answers (1) | Asked by : csr

What is difference between defining the DB2 cursor in working storage section and in procedure division? How does it affects to Cobol-DB2 program if the cursor is defined in working storage section and if defined in procedure section.
Read Answers (1) | Asked by : Ambrish Kulkarni


 Sponsored Links

 
Related Articles

C++ Pure Virtual Function and Base Class

C Pure Virtual Function and Virtual Base Class In this C tutorial you will learn about pure virtual function declaration of pure virtual function and virtual base class virtual base class and how to implement a virtual base class explained with examples mosgoogle center What is Pure Virtual Function
 

C++ Function Passing Types

C Function Passing Types In this C tutorial you will learn about function passing types two types of arguments passing in functions passed by value  and  passed by reference are discussed here mosgoogle center The arguments passed to a function can be performed in two ways Passed
 

What is DECODE function used for?

DECODE is used to decode a CHAR or VARCHAR2 or NUMBER into any of several different character strings or numbers based on value. That is DECODE does a value-by-value substitution. For every value that is given in the DECODE function it makes an if then check and matches the value. The general format
 

printf() Function Return Value

What is the return value from printf() function? printf function always returns the number of characters printed. Let us understand this with an example: main() { int a=10; printf("%d",printf("%d %d %d", a,a,a)); } In this above program the inner printf i
 

How is the main() function declared?

The declaration of main can be done as int main() One more declaration that can be taken by main is command line arguments form int main(int argc, char *argv[]) or this can also be written as int main(argc, argv) int argc; char *argv[]; NOTE: It is not possible for one to declare the main
 

How does the function call within function get evaluated?

Whenever we have more than one function which is called for a finite number of times then such a function gets evaluated from inside out. Let us understand this concept with an example. For instance consider a function sample called within it 4 times as given in program below: main() { int a=50;
 

What happens when a variable is not initialized in main function?

When a variable is not initialized in main function it contains garbage value. This can be well seen from the example below main() { int x; printf(“%d”,x); z= sample() } sample() { printf(“Testing program”); } Output is   &n
 

What is the default return value of a function?

The default return value from a function is int. In other words, unless explicitly specified the default return value by compiler would be integer value from function.   When a programmer wants other than integer values to be returned from function then it is essential that the pro
 

What happens when a variable is not declared in function definition?

Generally in C program the function definition and calling takes the form as given below: main() { int x,y,z; z=sample(x,y); printf(“%d”,z); } sample(x1,y1) int x1,y1; { int z1; z1= x1 - y1; return(z1); } Here what happens is the values x, y gets passed to x1,y1
 

What is difference between call by value and call by reference in function?

The arguments passed to function can be of two types 1. Values passed 2. Address passed The first type refers to call by value and the second type refers to call by reference. For instance consider program1 main() { int x=50, y=70; interchange(x,y); printf(“x=%d y=%d”,x,
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape