2015-01-12 23:45 GMT-02:00, Douglas Fabiano Specht <[email protected]>: > Boa noite Pessoal, > > tenho uma função bem simples, mas ao tentar executar diz que nao existe, > alguem pode me dizer o que estou fazendo errado? > > CREATE OR REPLACE FUNCTION get_nova_mensagem(_idexterno integer, _idempresa > integer, _mensagem text, _telefone text, _tipopessoa integer, _dtregistro > timestamp without time zone, _status integer) RETURNS bigint AS > $BODY$ > DECLARE > _idmensagem integer; > BEGIN > INSERT INTO mensagem(idexterno, idempresa, mensagem, telefone, > tipopessoa, dtregistro, status) > VALUES (_idexterno, _idempresa, _mensagem, _telefone, _tipopessoa, > _dtregistro, _status) RETURNING id INTO STRICT _idmensagem; > RETURN _idmensagem; > END; > $BODY$ > LANGUAGE plpgsql VOLATILE > COST 100; > ALTER FUNCTION get_nova_mensagem(integer, integer, text, text, integer, > timestamp without time zone, integer) > OWNER TO dk; > > executo o comando: SELECT * FROM get_nova_mensagem(1, 1, 'teste', > '9900000', 1, now(), 0); > > > ERROR: function get_nova_mensagem(integer, integer, unknown, unknown, > integer, timestamp with time zone, integer) does not exist > LINE 1: SELECT * FROM get_nova_mensagem(1, 1, '', '', 1, now(), 0); > ^ > HINT: No function matches the given name and argument types. You might > need to add explicit type casts. > ********** Error ********** > > ERROR: function get_nova_mensagem(integer, integer, unknown, unknown, > integer, timestamp with time zone, integer) does not exist > SQL state: 42883 > Hint: No function matches the given name and argument types. You might need > to add explicit type casts. > Character: 15 > >
Atente para a definição da função (timestamp without time zone) e para a chamada (timestamp with time zone). Osvaldo _______________________________________________ pgbr-geral mailing list [email protected] https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
