On Mon, Jan 16, 2006 at 12:17:26PM -0800, sunithab@xxxxxxxxxxxxxx wrote: > The following query is working when this is used by static cursor. This > will return all the properties within the distance of 20 miles [...] > But When I am trying to build the dynamic sql string to a refcursor it is > not able to identify the syntax Could you post a complete function instead of just excerpts? That would make it easier to understand what you're doing and to see where the problem is. Please simplify the example function as much as possible -- it should have enough code to demonstrate the problem and to work in some sense if the problem didn't happen, but no more code than that (some people post long, complex functions or queries when the real problem could be demonstrated in only a few lines; the extraneous code isn't relevant to the problem and just gets in the way of debugging). -- Michael Fuhr