ERROR执行函数postgresql

时间:2016-11-04 00:38:26

标签: sql postgresql

我试图弄清楚我做错了什么 我有一个以:

开头的函数
CREATE OR REPLACE FUNCTION public.insert_contato_site(
_nome character varying,
_sobrenome character varying,
_sexo character varying,
_cpf character varying, 
_nascimento date, 
_end_logradouro character varying, 
_end_numero character varying,
_end_complemento character varying,
_end_bairro character varying,
_end_cidade character varying,
_end_estado character varying,
_end_cep character varying,
_email character varying,
_tel_fixo character varying,
_tel_celular1 character varying,
_metodo_pgto character varying,
_dia_pgto integer, _valor numeric,
_debito_agencia character varying,
_debito_conta character varying,
_cc_num character varying,
_cc_cvv character varying,
_cc_vencimento character varying,
_cc_nome character varying)
     RETURNS integer
     LANGUAGE plpgsql
    AS $function$


当我尝试执行它时,例如:

SELECT * FROM insert_contatos_site (
    'John'::VARCHAR,
    'Smith'::VARCHAR,
    'N'::VARCHAR,
    '11111'::VARCHAR,
    '1900-01-01'::DATE,
    'Av Nossa Sra de Copacabana'::VARCHAR,
    '419'::VARCHAR,
    '1'::VARCHAR,
    NULL::VARCHAR,
    'RIO DE JANEIRO'::VARCHAR,
    'RJ'::VARCHAR,
    '22710-790'::VARCHAR,
    NULL::VARCHAR,
    '21 1234-5678'::VARCHAR,
    NULL::VARCHAR,
    'BOLETO'::VARCHAR,
    15,
    200.0,
    NULL ::VARCHAR,
    NULL::VARCHAR,
    NULL::VARCHAR,
    NULL::VARCHAR,
    NULL::VARCHAR,
    NULL::VARCHAR)

它给了我这个错误:
[42883]错误:函数insert_contatos_site(字符变化,字符变化,字符变化,字符变化,日期,字符变化,字符变化,字符变化,字符变化,字符变化,字符变化,字符变化,字符变化,字符变化,字符变化,字符变化,整数,数字,字符变化,字符变化,字符变化,字符变化,字符变化,字符变化)不存在
  提示:没有函数匹配给定的名称和参数类型。您可能需要添加显式类型转换。
  位置:15


如您所见,所有参数都是explcit类型转换,但仍然无效。想法?

2 个答案:

答案 0 :(得分:3)

你拼错了你的函数的名字insert_contato_site没有s

答案 1 :(得分:1)

你拼错了。它应该是:

SELECT * FROM insert_contato_site(

你说:

SELECT * FROM insert_contatos_site(