|
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 |