Thanks Tom. I didn't know I needed a RETURN statement at the end. I assumed that the "return next" statement would be enough. It works fine now. ----------------------------------------------- Ignacio Colmenero Software Development Micotan Software Company Ltd. -----Original Message----- From: pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of Tom Lane Sent: February 11, 2005 12:28 PM To: Ignacio Colmenero Cc: pgsql-general@xxxxxxxxxxxxxx Subject: Re: ERROR: control reached end of function without RETURN "Ignacio Colmenero" <ignacio.colmenero@xxxxxxxxxxx> writes: > I get the error: ERROR: control reached end of function without RETURN > What can be wrong? You don't have a RETURN statement. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org