calling function - Mailing list pgsql-sql

From William Anthony Lim
Subject calling function
Date
Msg-id HJIPBHMLGOCCGAAA@whowhere.com
Whole thread Raw
Responses Re: calling function
List pgsql-sql
Hi,
I have a little trouble. I'm newbie in postgresql.

Consider this function example:

create or replace function testcall(int4,varchar,bool,int2) return setof record as '
declarer record;a int4;b varchar;c bool;d int2;
begina=$1;b=$2;c=$3;d=$4;
for r in select * from "T_Customer" loop    return next r;end loop;
return r;
end;'
language 'plpgsql'


when i tried to call it using:
select * from testcall(12,'ABCD',true,20000);

it says:
ERROR:  function testcall(integer, "unknown", boolean, integer) does not exist

then I tried to change to:
select * from testcall(12,varchar'ABCD',true,20000);

it says:
ERROR:  function testcall(integer, character varying, boolean, integer) does not exist

I've tried them using jdbc prepared statement and callable statement (both with/without parameters), but the result is
thesame.
 
what should i do?

Thanks

William


Need a new email address that people can remember
Check out the new EudoraMail at
http://www.eudoramail.com


pgsql-sql by date:

Previous
From: Joe Conway
Date:
Subject: Re: Encoding bytea
Next
From: Tom Lane
Date:
Subject: Re: calling function