What is the purpose of coding FETCH in a SQL SELECT query?
Explain with an example in Detail?

Answers were Sorted based on User's Feedback



What is the purpose of coding FETCH in a SQL SELECT query? Explain with an example in Detail?..

Answer / guest

FETCH is used to retrieve a specific row from a result set
of the SELECT query and places them into local variables.

Is This Answer Correct ?    2 Yes 0 No

What is the purpose of coding FETCH in a SQL SELECT query? Explain with an example in Detail?..

Answer / anandrao

FETCH will give only the number of rows equal to the number
specified with FETCH from resultset given by query.
e.g. consider ACCOUNT_MASTER table contains 100 rows.
SELECT *
FROM ACCOUNT_MASTER
FETCH FIRST 10 ROWS ONLY.
Will give only first 10 rows of ACCOUNT_MASTER table from
100 rows of ACCOUNT_MASTER table

Is This Answer Correct ?    1 Yes 0 No

What is the purpose of coding FETCH in a SQL SELECT query? Explain with an example in Detail?..

Answer / siri reddy

Inorder to select first n number of rows fetch is used in
conjunction with select statement

Is This Answer Correct ?    1 Yes 1 No

What is the purpose of coding FETCH in a SQL SELECT query? Explain with an example in Detail?..

Answer / akviswa

PS: fetch can be used in select only in case of cursor
select

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More DB2 Interview Questions

Name the various locking levels available?

0 Answers  


suppose in my table 10 rows are there , i want to update odd rows salary as 90000 ? how u do it ? any one help me ? what do we use here cursor-fetch or normal sql ?

5 Answers   IBM,


What is the function of buffer manager?

1 Answers  


COBOL PRECOMPILER ERROR: "XXXXXX" (TABLE) PREVIOUSLY DECLARED OR REFERENCED DCLGEN VARIABLES GETS IMPORTED TWICE FOR ONLY ONE EXEC SQL STATEMENT. WHAT COULD BE THE PROBLEM?

1 Answers  


What is with ur in db2?

0 Answers  






What is a DB2 bind?

1 Answers   Logica CMG,


How can you count the number of rows from a table tab?

0 Answers  


What is dbrm in db2 database?

0 Answers  


How to define the data items to receive the fetch items for the SQL?

2 Answers  


What is the function of the Data Manager?

2 Answers  


cursor with hold explain ?

1 Answers   Verizon,


What is the role of schema in the db2 database?

0 Answers  


Categories