Search Postgresql Archives

PLpgSQL-Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux