2016-12-17 3 views
0

次Postgresqlのルーチンを考える:私は次のエラーNpgsqlの通話機能/

PostgresException: 42883: function checkemailexists(emailAddress => text) does not exist

を得続ける

public bool EmailExists(string email) 
     { 
      using (var conn = Connection) 
      { 
       conn.Open(); 
       using(var tran = conn.BeginTransaction()) 
       using (var cmd = new NpgsqlCommand("checkemailexists", conn)) 
       { 
        cmd.CommandType = System.Data.CommandType.StoredProcedure; 
        cmd.Parameters.AddWithValue("@emailAddress",NpgsqlTypes.NpgsqlDbType.Text ,"[email protected]"); 
        var ret = (bool)cmd.ExecuteScalar(); 
        return ret; 
       } 
      } 
     } 

CREATE OR REPLACE FUNCTION checkemailexists (emailaddress text) RETURNS boolean 
    LANGUAGE plpgsql 
AS $$ 
#print_strict_params on 
DECLARE 
existsCount int; 
BEGIN 
    SELECT count(*) INTO STRICT existsCount 
     FROM usercontacts WHERE usercontacts.contactaddress = emailAddress; 
    IF existsCount > 0 THEN RETURN TRUE; 
    ELSE RETURN FALSE; 
    END IF; 
END 
$$ 

と.NET以下(Npgsqlの)ブロック

私はポストグルの新入生です。私は非常に成功していません関連する回答の検索。

私は電話をしようとするとこの機能が見つからない理由を理解できますか?

SELECT version();

PostgreSQL 9.5.5 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.3.1-14ubuntu2) 5.3.1 20160413, 64-bit

.NETのコア

Npgsqlの3.1.9

ありがとうございます!

答えて

3

Welp ...大文字と小文字は区別されます。

emailaddress!= emailaddress