Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Problem with function, type cast?



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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group