From: | "Fernando Papa" <fpapa(at)claxson(dot)com> |
---|---|
To: | "Edwin Quijada" <listas_quijada(at)hotmail(dot)com>, "Pgsql" <pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx> |
Subject: | RE: [Pgsql-ayuda] Error en la funcion |
Date: | 2003-09-02 13:31:37 |
Message-ID: | F1DC5B511E2D1C499E5E20FC6D74160D03F7D53B@exch2000.buehuergo.corp.claxson.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Reemplaza esta linea:
> if ($2='rep') then
por
> if ($2=''rep'') then
Supongo que es eso...
--
Fernando O. Papa
DBA
> -----Mensaje original-----
> De: Edwin Quijada [mailto:listas_quijada(at)hotmail(dot)com]
> Enviado el: martes, 02 de septiembre de 2003 22:29
> Para: Pgsql
> Asunto: [Pgsql-ayuda] Error en la funcion
>
>
> Tengo un error en la sigte funcion cuando comparo con strings.
> Este es el error que consigo no se porque tal vez estoy
> preguntandoi mal??
>
> :Error: parser: parse error at or near "rep" at character 116
>
> Este es mi codigo:
>
> CREATE FUNCTION testp(int4,char,int4) RETURNS numeric AS ' DECLARE
> tipo int;
> reg record;
> BEGIN
> if ($2='rep') then
> tipo:=1;
> end if;
>
> SELECT INTO reg * FROM t_comisiones a,t_superior b
> WHERE a.f_codigo_agente = $1 AND
> a.f_codigoramo = tipo AND
> b.f_whole = a.f_whole AND
> b.f_nivel = $3 ;
> --
> IF FOUND THEN
> RETURN (reg.f_comision/100);
> ELSE
> RETURN 0;
> END IF;
> END;'
> LANGUAGE 'plpgsql'; _______________________________________________
> Pgsql-ayuda mailing list
> Pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx
> http://tlali.iztacala.unam.mx/mailman/listinfo/pgsql-ayuda
>
From | Date | Subject | |
---|---|---|---|
Next Message | Terry Yapt | 2003-09-02 13:46:54 | Re: [Pgsql-ayuda] NULL en valores concatenados |
Previous Message | Antonio Castro | 2003-09-02 09:37:44 | [Pgsql-ayuda] Duda sobre template1 |