From: fathur rohman <fathur_edp@yahoo.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Function Parameter Problem
Date: Sat, 18 Feb 2006 07:40:39 +0000 (GMT)
Message-ID: <20060218074039.35198.qmail@web36806.mail.mud.yahoo.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: fathur_edp@yahoo.com
Subject: Re: Function Parameter Problem
In-Reply-To: <20060218074039.35198.qmail@web36806.mail.mud.yahoo.com>
References: <20060218074039.35198.qmail@web36806.mail.mud.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox