Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id DC5976333DE for ; Mon, 11 Jan 2010 07:35:01 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 51885-01 for ; Mon, 11 Jan 2010 11:34:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.fmed.uba.ar (mail.fmed.uba.ar [157.92.152.1]) by mail.postgresql.org (Postfix) with ESMTP id 4FB0D6326DD for ; Mon, 11 Jan 2010 07:34:51 -0400 (AST) Received: from www.webmail.fmed.uba.ar (localhost [127.0.0.1]) by mail.fmed.uba.ar (Postfix) with ESMTP id D5FC939C5ED; Mon, 11 Jan 2010 08:33:32 -0200 (ARST) Received: from 190.55.96.62 (SquirrelMail authenticated user gherzig) by www.webmail.fmed.uba.ar with HTTP; Mon, 11 Jan 2010 08:33:33 -0200 (ARST) Message-ID: <4b9e9f07701f20f59fa63e18f73cb311.squirrel@www.webmail.fmed.uba.ar> In-Reply-To: References: <6f55ccf2a59fe7bca287389ec92e5f91.squirrel@www.webmail.fmed.uba.ar> Date: Mon, 11 Jan 2010 08:33:33 -0200 (ARST) Subject: Re: problem using regexp_replace From: gherzig@fmed.uba.ar To: "Jasen Betts" Cc: pgsql-sql@postgresql.org User-Agent: SquirrelMail/1.4.15 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.189 tagged_above=-10 required=5 tests=BAYES_50=0.001, FH_DATE_PAST_20XX=3.188 X-Spam-Level: *** X-Archive-Number: 201001/17 X-Sequence-Number: 33553 > On 2010-01-11, gherzig@fmed.uba.ar wrote: > >> CREATE FUNCTION valores_sustitucion(valor_ingresado varchar[]) >> returns varchar >> as >> $$ >> select case >> $1[1] when 'Action_1' then >> (select descripcion from load_by_cod($1[2])) >> >> when 'Action_2' then (select descripcion from pay_by_view($1[2]) >> >> else 'FALSE' >> end; >> $$ language sql; > >> Anybody has a hint? > > you are missing a ) > Oh, thats a copy-paste problem, sory about that. I forgot to mention, this is a 8.3 running on linux. Gerardo