type cast for ERROR: function chr(double precision) does not exist???

Started by Marcel Boscheralmost 22 years ago1 messagesgeneral
Jump to latest
#1Marcel Boscher
mboscher@emedia-office.de

Hello everybody,

i get strange error messages when trying to call up my function

with a SELECT functionname(with or without int);

varying from:

ERROR: function chr(double precision) does not exist
ERROR: function FUNCTIONNAME() does not exist

the problem maybe :
SELECT chr(trunc((random()*26)+65))
is there anything i need to type cast?

i have tried several

CREATE CAST (* AS *);
in particularly every possible row ;-)

DECLARE
anzahl alias for $1;
i int4;
zeichen char(1);
zufallstext text;
entries int8;
BEGIN
LOOP
zufallstext := '';
for i in 1..anzahl LOOP
SELECT chr(trunc((random()*26)+65)) INTO zeichen;
zufallstext := zufallstext || zeichen;
END LOOP;
SELECT count(*) INTO entries FROM se_errorcode
WHERE entry = zufallstext;
EXIT WHEN entries = 0;
END LOOP;
RETURN zufallstext;
END;