PLpgSQL-Problem

From: "Thomas Chille" <thomas(at)chille(dot)de>
To: <pgsql-general(at)postgresql(dot)org>
Subject: PLpgSQL-Problem
Date: 2004-04-15 14:55:28
Message-ID: 015c01c422f9$b17655a0$500a0a0a@spoon.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

i am playing around with PLpgSQL and can not solve one problem: I am fetching some rows of a special rowtype and wanna give this
rows step by step to a function with this rowtype as parameter.

evertime i get the errormessage: ERROR: Attribut »_row« not found

but the Attribut exists and has values in his fields. i have absolutly no idea was happens there. can someone help me please?

thanx
thomas

-------snip function 1

CREATE OR REPLACE FUNCTION "public"."compress_main" (date) RETURNS boolean AS'
DECLARE
_day ALIAS FOR $1;
_row public.tmp_order_data%ROWTYPE;
_result boolean;
eb bigint;
BEGIN

DELETE FROM hlp_operator WHERE selling_date = _day;

FOR _row IN
SELECT * FROM tmp_order_data WHERE business_day = _day ORDER BY transactiontime
LOOP
IF _row.id_transactiontype = 100 THEN
SELECT INTO _result compress_100(_row);
END IF;
END LOOP;

RETURN TRUE;
END;
'LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;

-------snip function 2:

CREATE OR REPLACE FUNCTION "public"."compress_100" ("public"."tmp_order_data") RETURNS boolean AS'
DECLARE
_record ALIAS FOR $1;
_shift int8;
BEGIN

/* any code */

RETURN TRUE;
END;
'LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martin Marques 2004-04-15 14:58:27 Re: Problems with Triggers
Previous Message Alan Graham 2004-04-15 14:11:13 Anyone using pgreplicator?