FW: Noticed a Bug with stored procedures - Mailing list pgsql-bugs

From Gudala, Sridhar (GE EntSol, Intelligent Platforms)
Subject FW: Noticed a Bug with stored procedures
Date
Msg-id 7523F73028C99B418C43A45DCDDAA98E030053B4@CINMLVEM23.e2k.ad.ge.com
Whole thread Raw
Responses Re: FW: Noticed a Bug with stored procedures  (Korry Douglas <korry.douglas@enterprisedb.com>)
List pgsql-bugs
Hi,
=20
Please ignore my previous mail, there were few spelling mistakes. Now
you can go through below mail and respond to it.

When I send update query command from front end then PostGreSql is
responding with number of rows affected. But when I send same update
query which is embedded in stored procedure (as listed below) then
PostGreSql respond with a value of -1.
=20
=20
CREATE  OR REPLACE FUNCTION samplepro5(deptid int)
RETURNS void AS
$BODY$
UPDATE EmailLoginUsers SET LoginID =3D 'abc@sample.com Where
UserCheckedMailID =3D $1;
$BODY$
LANGUAGE 'sql' VOLATILE
COST 100;
=20
=20
=46rom front end, I have called above listed stored procedure by using
below listed code:
=20
objNpgSQLCommand.CommandText =3D "samplepro5";

objNpgSQLCommand.CommandType =3D CommandType.StoredProcedure;

NpgsqlParameter objParameter;

objparameter.ParameterName =3D "deptid";

objparameter.NpgsqlDbType =3D NpgsqlTypes.NpgsqlDbType.Integer;

objparameter.Value =3D 1;

objparameter.Direction =3D ParameterDirection.Input;

objNpgSQLCommand.Parameters.Add(objParameter);

int numberOfAffectedRows =3D objNpgSQLCommand.ExecuteNonQuery();

After excuting above code, the value of numberOfAffectedRows  was -1 but
database was updated with one record.

=20

Please tell me what's wrong.

=20

Thanks,

Sridhar G

=20

pgsql-bugs by date:

Previous
From: "Gudala, Sridhar (GE EntSol, Intelligent Platforms)"
Date:
Subject: Noticed a Bug with stored procedures
Next
From: Tom Lane
Date:
Subject: Re: 9.0_alpha4 Planner Bug