Re: Function call

From: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Function call
Date: 2009-01-24 14:13:50
Message-ID: 20090124141350.GA11665@tux
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Nico Callewaert <callewaert(dot)nico(at)telenet(dot)be> schrieb:

> Hi again,
>
> I tried your solution, but it gives me still the same error message. But
> there is a dotted line under the funcion name, like the error is pointing to
> the function name. Is that the correct way to execute a function, using
> SELECT ?

Sorry, you should also cast the 1 to smallint:

test=# CREATE OR REPLACE FUNCTION upd_afdeling(update_type text, in_afd_id smallint, in_afd_omschrijving text, in_date_changed timestamp without time zone) RETURNS integer AS $BODY$ BEGIN return 1; END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100;
CREATE FUNCTION
Zeit: 0,607 ms
test=*# select upd_afdeling('I'::text, 1::smallint, 'afdeling 1'::text, current_timestamp::timestamp);
upd_afdeling
--------------
1
(1 Zeile)

Zeit: 0,281 ms
test=*# select upd_afdeling('I'::text, 1, 'afdeling 1'::text, current_timestamp::timestamp);
ERROR: function upd_afdeling(text, integer, text, timestamp without time zone) does not exist
LINE 1: select upd_afdeling('I'::text, 1, 'afdeling 1'::text, curren...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.

>
> Thanks again, Nico
>
>
> ----- Original Message ----- From: "Andreas Kretschmer"

Please, no top-posting:

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Nico Callewaert 2009-01-24 14:29:31 Re: Function call
Previous Message Nico Callewaert 2009-01-24 13:49:12 Re: Function call