Hi,
I am testing PL/Perl under Postgresql 8.1.3, and I habe the following test
procedure:
--------------
CREATE FUNCTION perl_test(a inout integer, b inout integer, r1 out integer,
r2 out integer) SETOF record AS
'
my ($a, $b) = @_;
$r1 = $a + $b;
$r2 = $a * $b;
return_next {a => $a, b => $b, r1 => $r1, r2 => $r2};
return_next {a => $b, b => $a, r1 => $r1, r2 => $r2};
return undef;
' LANGUAGE plperl;
--------------
How would you translate that in PL/Ruby?
I have a link to http://moulon.inra.fr/ruby/plruby.html, which is apprently
the only documentation, and I find it quite hard to do the translation.
Thanks!
----------------------------------
Philippe Lang, Ing. Dipl. EPFL
Attik System
rte de la Fonderie 2
1700 Fribourg
Switzerland
http://www.attiksystem.ch
Tel: +41 (26) 422 13 75
Fax: +41 (26) 422 13 76
"Philippe Lang" <philippe.lang@attiksystem.ch> writes:
> CREATE FUNCTION perl_test(a inout integer, b inout integer, r1 out integer,
> r2 out integer) SETOF record AS
> How would you translate that in PL/Ruby?
I think you wouldn't :-( --- AFAICT from the documentation, plruby
doesn't know about OUT parameters yet. You'll need to make an
explicitly declared composite type for the result rows, instead.
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера