cheers enrico When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser, so that I am sure that the information requested can be reached with a very small effort
Sandip - Where are you running the dynamic sql...? Need more information. In the mainframe world running a sql via qmf or spufi is considered to be a dynamic sql. In that sense "YES" you can run a dynamic sql to retrieve data without using a cursor.
This is a HELP forum, not a WRITE-THE-CODE-FOR-YOU forum. However, I'm sure a number of people who respond on this forum would write the code for you provided you pay the appropriate professional fee (rates usually run about U.S. dollars 700 to 1500 per day for professional work product). If you get stuck writing the code, ask for help -- but we're not going to just give you the code since you're not learning anything by that.