[Pgsql-ayuda] Cual es el error
Edwin Quijada
listas_quijada@hotmail.com
Wed, 3 Sep 2003 03:36:28 -0400
Tengo un error un poco extrano en esta funcion: Me da este error
WARNING: Error occurred while executing PL/pgSQL function cortar_char
WARNING: line 8 at select into variables
ERROR: Unable to identify an operator '=' for types 'name' and 'character'
You will have to retype this query using an explicit cast
--Este es el codigo de la funcion--
CREATE FUNCTION cortar_char(bpchar,bpchar,bpchar) RETURNS int4 AS '
DECLARE
tabla ALIAS FOR $1;
campo ALIAS FOR $2;
dato ALIAS FOR $3;
len int;
reg record;
BEGIN
select into reg b.atttypmod
from pg_class a, pg_attribute b, pg_type c
where a.relname = tabla
and b.attrelid = a.relfilenode
and b.attname = campo
and b.attnum >0
and b.atttypid = c.oid;
len:=reg.lon;
return len;
END;'
LANGUAGE 'plpgsql';