Re: Problem with function, type cast? - Mailing list pgsql-novice

From A. Kretschmer
Subject Re: Problem with function, type cast?
Date
Msg-id 20080516071902.GB25119@a-kretschmer.de
Whole thread Raw
In response to Problem with function, type cast?  ("A B" <gentosaker@gmail.com>)
List pgsql-novice
am  Thu, dem 15.05.2008, um 16:47:33 +0200 mailte A B folgendes:
> I have written this little silly function
>
> CREATE OR REPLACE FUNCTION recordMail(customerId_ integer, message_
> VARCHAR(240)) RETURNS void AS $$
> BEGIN
>        INSERT INTO MailRecord (custid,message) VALUES (customerId_, message_);
> END;
> $$ LANGUAGE plpgsql;
>
> And it is created, and then I do:
>
> select recordMail(10,'asd');
>
> and I get
>
>
> ERROR:  function recordmail(integer, "unknown") does not exist
> LINE 1: select recordMail(10,'asd');

Sorry, but i can't reproduce this error:

test=# create table mailrecord (custid int, message text);
CREATE TABLE
test=*# CREATE OR REPLACE FUNCTION recordMail(customerId_ integer, message_
test(# VARCHAR(240)) RETURNS void AS $$
test$# BEGIN
test$#        INSERT INTO MailRecord (custid,message) VALUES (customerId_, message_);
test$# END;
test$# $$ LANGUAGE plpgsql;
CREATE FUNCTION
test=*# select recordMail(10,'asd');
 recordmail
------------

(1 row)

test=*#


Which version do you have? I have 8.1.

Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

pgsql-novice by date:

Previous
From: "A B"
Date:
Subject: Re: type cast of function arguments
Next
From: "Leo"
Date:
Subject: Need values for encoding table