View previous topic :: View next topic
|
Author |
Message |
ritesh pandey
New User
Joined: 09 Feb 2007 Posts: 11 Location: Pune
|
|
|
|
Can we use where clause while fetching the records from db2 through cursor in db2? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
yes.
keep in mind, that for embedded sql, a cursor is the only way to return more than one row.
so the difference between a cursor and a singleton-select is the expected return for a singleton-select is no more than one row.
so, anything that you can code for a singleton-select you can code for a cursor.
update cursors are only restricted in that you can not order them. |
|
Back to top |
|
|
Siddharth Bahirsheth
New User
Joined: 23 Jul 2007 Posts: 16 Location: Mumbai
|
|
|
|
I think he mean to say..a FETCH CURSOR query ...Can we use a where clause in a FETCH CURSOR . |
|
Back to top |
|
|
Shobana Bhaskar
New User
Joined: 02 Mar 2007 Posts: 35 Location: Pennsylvania, US
|
|
|
|
You have to include WHERE clause in DECLARE CURSOR statement. You cannot have in FETCH statement. Fetch statement will get the values from table for the filters (WHERE clause) defined in DECLARE CURSOR statement. |
|
Back to top |
|
|
|