Reference to a hash as argument for a plperl-function
am 13.07.2007 08:41:06 von mr16Hello,
is it possible to pass a reference to a hash from my perl-script as
argument to a plperl-function in a Postgresql-database?
E.g. lets take a function like this:
CREATE FUNCTION repl (INT,HASHREF) RETURNS TEXT AS '
return $$_[1]{$_[0]};
' LANGUAGE plperl;
In my Perl-programm I would do the query via DBD::Pg
SELECT repl(col1,'\%hvar') FROM table;
and get back the hashvalue that is represented by the key "col1" taken
from "table" (or as coding: $hvar{col1} )
I tried that solution without success. Do I have just an error in this
programm or is it a principally problem?
Thank you very much for answering
Michael