*Buenos Dias:*
EL mismo codigo lo probe en un pgAdmin III y funciona de lo mas normal, pero
en phpPgAdmin me emite este mensaje... de antemano muchas gracias por la
ayuda que me puedan brindar.
*SQL error:*
ERROR: syntax error at or near "CREATE" at character 32
*In statement:*
SELECT COUNT(*) AS total FROM (CREATE OR REPLACE FUNCTION
"public"."sp_nueprofesor" () RETURNS char AS
$body$
DECLARE
cod_nue char(5);
aux char(20);
BEGIN
select into cod_nue max(procod) from profesor;
if cod_nue is null then
cod_nue='00001';
else
aux='00000'|| cast((cast(cod_nue as int4)+1) as char(5));
cod_nue=substr(aux,length(aux)-1,5);
end if;
return cod_nue;
END;
$body$
LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER) AS sub
Atte
*Jorge Diaz*