From: | Mike G <mike(at)thegodshalls(dot)com> |
---|---|
To: | Marcel Boscher <mboscher(at)emedia-office(dot)de> |
Cc: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: Script done. |
Date: | 2004-08-11 04:11:15 |
Message-ID: | 20040811041115.GC19602@localhost.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Hello,
I believe you need to call your function as pass an int everytime.
SELECT zufall(0);
If you have multiple databases, not in schema sense, make sure you clicked somewhere on the screen within that database so the sql window points to that database.
Mike
On Tue, Aug 10, 2004 at 05:08:39PM +0200, Marcel Boscher wrote:
> 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';
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
From | Date | Subject | |
---|---|---|---|
Next Message | Mike G | 2004-08-11 04:30:31 | Re: New installation of 8.0 Beta1 Failed to create process for initdb: 1385 |
Previous Message | Bruce Momjian | 2004-08-11 01:44:46 | Re: What constitutes a pgsql session? |