Skip site navigation (1) Skip section navigation (2)

BUG #3771: function pg_catalog.btrim(numeric, unknown) does not exist

From: "Oliver Artelt" <oli(at)cubeoffice(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3771: function pg_catalog.btrim(numeric, unknown) does not exist
Date: 2007-11-21 13:21:39
Message-ID: 200711211321.lALDLdFS085326@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      3771
Logged by:          Oliver Artelt
Email address:      oli(at)cubeoffice(dot)de
PostgreSQL version: 8.3-beta2
Operating system:   Win XP, SP 2, 32b
Description:        function pg_catalog.btrim(numeric, unknown) does not
exist
Details: 

definition:

CREATE OR REPLACE FUNCTION saufschlagreihe(integer, smallint)
  RETURNS text AS
$BODY$
DECLARE

    LEID    ALIAS FOR $1;
    iFormat ALIAS FOR $2;

    sResult text;
    s       text;
    r       record;
    d       numeric;

BEGIN

    s := 'SELECT AufschlagNameKurz,AufschlagProz,AufschlagZeit FROM
tblAufschlag INNER JOIN tblAufschlagTyp ON Key_AufschlagTyp =
ID_AufschlagTyp WHERE Key_LE = ' || LEID;
    sResult = '';

    FOR r IN EXECUTE s LOOP


        ---------
        --Kurzbez
        ---------
        if iFormat = 0 then

            sResult := sResult || ', ' || r.AufschlagNameKurz;

        ------------------
        --Kurzbez, Prozent
        ------------------
        elsif iFormat = 1 then

            sResult := sResult || ', ' || r.AufschlagNameKurz || ' (' ||
r.AufschlagProz || '%)';

        -----------------------------
        --Kurzbez, Zeitdauer, Prozent
        -----------------------------
        else

            d := r.AufschlagZeit;
            If d > 0 Then

                sResult := sResult || ', ' || r.AufschlagNameKurz || ' (';
                if d / 60 = (d / 60)::int4 then
                    sResult := sResult || trim(to_char(d / 60, '990'));
                else
                    sResult := sResult || trim(to_char(d / 60, '990.00'));
                end if;
                sResult := sResult || 'h * ' || trim(both '0' from
r.AufschlagProz) || '%)';

            End If;
        end If;

    end Loop;


    return trim(overlay(sResult placing '  ' from 1));

END;
$BODY$
  LANGUAGE 'plpgsql' STABLE
  COST 100;


call:


select saufschlagreihe(69128, 2::smallint);


msg:



ERROR:  function pg_catalog.btrim(numeric, unknown) does not exist
LINE 1: SELECT   $1  || 'h * ' || trim(both '0' from  $2 ) || '%)'
                                  ^
HINT:  No function matches the given name and argument types. You might need
to add explicit type casts.
QUERY:  SELECT   $1  || 'h * ' || trim(both '0' from  $2 ) || '%)'
CONTEXT:  PL/pgSQL function "saufschlagreihe" line 47 at assignment

********** Fehler **********

ERROR: function pg_catalog.btrim(numeric, unknown) does not exist
SQL Status:42883
Hinweis:No function matches the given name and argument types. You might
need to add explicit type casts.
Kontext:PL/pgSQL function "saufschlagreihe" line 47 at assignment



works on 8.2.4 and older



regards, oli

Responses

pgsql-bugs by date

Next:From: Peter EisentrautDate: 2007-11-21 14:26:29
Subject: Re: BUG #3771: function pg_catalog.btrim(numeric, unknown) does not exist
Previous:From: CNDate: 2007-11-21 13:15:21
Subject: BUG #3770: Follow up: Fail to make bcc32.mak for libpq

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group