Syntax Error

From: Marcel Boscher <mboscher(at)emedia-office(dot)de>
To: pgsql-novice(at)postgresql(dot)org
Subject: Syntax Error
Date: 2004-08-10 12:44:52
Message-ID: 4118C344.3020408@emedia-office.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hey there,

ERROR: function round(double precision, integer, integer) does not exist
Any suggestions

Purpose is to generate a 4 digit errorcode 1st letter alpha - rest numeric

my source code:

DECLARE
chars nchar(26);
charpos INTEGER;
character nchar(4);
nentries INTEGER;
key INTEGER;

BEGIN
chars := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
charpos := Round((random() * (length(chars)-1)), 0, 0);
character := SubString(chars, charpos, 1) ;

nentries := 1;
WHILE (nentries > 0) LOOP
key := trunc(random() * 10000);

SELECT eCode = character + key

SELECT
INTO nentries
count(*)
FROM se_errorcode
WHERE se_errorcode.entry = eCode;
END LOOP;

INSERT
INTO se_errorcode (entry)
VALUES (eCode);

RETURN(eCode);
END;

Thx in advance
Marcel

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Oliver Elphick 2004-08-10 13:12:27 Re: Syntax Error
Previous Message Jake Stride 2004-08-10 11:24:05 DISTINCT ordering