Reference to a hash as argument for a plperl-function
- From: mr16@xxxxxx (Michael Rudolph)
- Date: Thu, 12 Jul 2007 23:41:06 -0700
Hello,
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
.
- Follow-Ups:
- Re: Reference to a hash as argument for a plperl-function
- From: Greg Sabino Mullane
- Re: Reference to a hash as argument for a plperl-function
- Prev by Date: Trouble Installing DBD::ODBC with postgresql
- Next by Date: Re: Trouble Installing DBD::ODBC with postgresql
- Previous by thread: Trouble Installing DBD::ODBC with postgresql
- Next by thread: Re: Reference to a hash as argument for a plperl-function
- Index(es):