From: | fathur rohman <fathur_edp(at)yahoo(dot)com> |
---|---|
To: | "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org> |
Subject: | Function Parameter Problem |
Date: | 2006-02-18 07:40:39 |
Message-ID: | 20060218074039.35198.qmail@web36806.mail.mud.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Hi Every Body,
i'v finished creating function generate_sjno(str_no
char(12), int_reset int2).
when it called an error message raised, this is the
illustration:
baisdb=> select generate_sjno('20060130',6);
ERROR: function generate_sjno("unknown", integer)
does not exist
HINT: No function matches the given name and argument
types. You may need to ad
d explicit type casts.
my questions :
1. is always char become bpchar on function
declaration?
2. is any missing on my function?
3. thanks all.
this my function declaration :
CREATE OR REPLACE FUNCTION generate_sjno(str_no
bpchar, int_reset int2)
RETURNS bpchar AS
$BODY$
declare
stran char(12);
srsj char(4);
begin
select into stran max(substr(tranno,9,4)) from
tran_hd where substr(tranno,1,int_reset)=str_no;
if found then
srsj:=lpad(((trim(stran)::int2)+1)::varchar(4),4,'0');
else
srsj:='0001';
end if;
stran:=substr(str_no,1,8) || srsj;
return stran;
end;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;
Send instant messages to your online friends http://uk.messenger.yahoo.com
From | Date | Subject | |
---|---|---|---|
Next Message | fathur rohman | 2006-02-18 07:42:08 | Trigger and PL Registration Problem |
Previous Message | fathur rohman | 2006-02-18 07:38:16 | PGOLEDB Problems |