Function with record type as argument - Mailing list pgsql-novice

From Sean Davis
Subject Function with record type as argument
Date
Msg-id 009E963D-84CD-11D9-A6C7-000D933565E8@mail.nih.gov
Whole thread Raw
Responses Re: Function with record type as argument
List pgsql-novice
In a followup to an earlier question from today from another person, is
it possible to create and use a function that takes as input a generic
"record"?  Specifically, how would I use a function like:

create or replace function perl_columns(record) returns text as $a$
    my ($rec)=@_;
    my $xml_ex = '';
    foreach my $tag (keys %$rec) {
        $xml_ex = "<$tag>" . $rec->{$tag} . "</$tag>\n";
    }
    return $xml_ex;
$a$ language plperlu;

Thanks,
Sean


pgsql-novice by date:

Previous
From: john-paul delaney
Date:
Subject: Re: Query combination query.
Next
From: SG Edwards
Date:
Subject: Perl DBI connection to Postgres