PostGreSQL 8.0beta1 I have a function that uses a cursor and it is giving me the error: cursor "crsr" already in use when the parameters I pass in come from another table. The function works fine when I call it by itself, such as select PartNeedsReschedule(100,1) or select * from PartNeedsReschedule(100,1) but when I try select PartNeedsReschedule(PartID,1) from Parts then I get the error. It seems that when I qualify the query such as PartNeedsReschedule(PartID,1) from Parts where partid=100 then it works because it is only returning one row. Is this a known problem with cursor based functions that they can not be called by set based queries? Is there a workaround? Thank You Sim ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq