Script done... Function won´t work...

From: Marcel Boscher <mboscher(at)emedia-office(dot)de>
To: pgsql-novice(at)postgresql(dot)org
Subject: Script done... Function won´t work...
Date: 2004-08-10 15:08:39
Message-ID: 4118E4F7.5070807@emedia-office.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Once again, ;-)

The script is finally done i hope ...

i can create my function.... no problem
but when i'm calling it up with a
SELECT zufall(); statement pgAdmin
tells me there is no function with that name...
although its listed in my function list as zufall!!!! ...
<runningagainstthewallheadfirst>

SOURCE:
create or replace function zufall(int4) returns text as '
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;
' language 'plpgsql';

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Eduardo Vázquez Rodríguez 2004-08-10 15:29:43 Query result to a file
Previous Message Bruce Momjian 2004-08-10 14:54:20 Re: SOUNDEX