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
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 |
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 |
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 |
Answer / akviswa
PS: fetch can be used in select only in case of cursor
select
| Is This Answer Correct ? | 0 Yes | 0 No |
While unloading huge amount of data from table. Suddenly job failed some error. Imagine 1M data unloading, In that 90% data unloaded only 10% left, So if want to unload the rest 10% what needs to be done? Whether do i need to start from top or anything ?
When do you use the IMAGECOPY?
What is the SQL Communications Area and what are some of its key fields?
What does this mean ? GRANT BIND,EXECUTE ON PLAN MK2 TO PUBLIC;
Why select is not preferred in embedded sql programs?
How to access db2 tables in mainframe?
How do you retrieve the first 5 characters of firstname column of db2 table emp?
What do you mean by between and in? Is between inclusive of specified range values?
What is DB2 (IBM Database 2)?
How do I add a column in db2?
5 rows are inserted to a DB2 Table. Next 3 of those are updated, then a rollback is issued. What would happen when the rollback is issued?
Name the lockable units in DB2?