The README.spi said that $rv->{rows} should return the number of
rows affected for INSERT, UPDATE & DELETE.  It seems to return NULL.
@{$rv->{rows}} also returns NULL.


-- drop table users ( email text, who text );
create table users ( email text, who text );
insert into users values ('[EMAIL PROTECTED]', USER);

create or replace function upd_user( text )
returns integer as
'
my $email = $_[0];
my $qry = "update users set email=''".$email."'' where who = USER ; ";
my $rv = spi_exec_query( $qry );
elog NOTICE, $qry;
elog NOTICE, $rv->{status};
elog NOTICE, $rv->{rows};
return $rv->{rows};
' language 'plperl';

select val_user('[EMAIL PROTECTED]');

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to