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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Function with record type as argument



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)=(at)_;
	my $xml_ex = '';
	foreach my $tag (keys %$rec) {
		$xml_ex = "<$tag>" . $rec->{$tag} . "</$tag>\n";
	}
	return $xml_ex;
$a$ language plperlu;

Thanks,
Sean




Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group