Received: from unimur.um.es (unimur.um.es [155.54.1.1]) by hub.org (8.10.1/8.10.1) with ESMTP id e6D7oBW14081 for ; Thu, 13 Jul 2000 03:50:11 -0400 (EDT) Received: from aries.dif.um.es (aries.dif.um.es [155.54.210.253]) by unimur.um.es (8.9.1b+Sun/8.9.1) with ESMTP id JAA19083; Thu, 13 Jul 2000 09:50:09 +0200 (MET DST) Received: from dif.um.es (labredes15.dif.um.es [155.54.210.9]) by aries.dif.um.es (Postfix) with ESMTP id B0A9BEC1A; Thu, 13 Jul 2000 09:50:00 +0200 (MET DST) Message-ID: <396D74A4.DC1E2536@dif.um.es> Date: Thu, 13 Jul 2000 09:49:57 +0200 From: Gabriel =?iso-8859-1?Q?L=F3pez=20Mill=E1n?= X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.5-15 i586) X-Accept-Language: en MIME-Version: 1.0 To: Bob Kline Cc: pgsql-interfaces@postgresql.org Subject: Re: DELETING ROW References: Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by hub.org id e6D7oCW14086 X-Archive-Number: 200007/87 Bob Kline wrote: > On Wed, 12 Jul 2000, Gabriel [iso-8859-1] López Millán wrote: > > > > > Hi all. > > > > I'm traying to delete a row of a table. Te code is: > > > > String query = "DELETE FROM " + ID_REQUEST_TABLE + " WHERE id = '" + > > numReq+ "';"; > > int result = s.executeUpdate(query); > > System.out.println("result: " + result); > > if(result != 0) { > > ..... > > connection.commit(); > > } > > > > > > If file do not exists "result" should be "0" (JDBC API), if exists, > > it should be the number of the row that delete. But I always get the > > value "1", always, even if the row to delete is 5,6, ... 10. > > > > I'm using postgresql 7.02 with linux RedHat 6.0 and jdk1.2 > > > > Cheers, Gabi. > > > > If you read the docs a little more carefully, I think you'll find that > the return value is the number of rows affected by the statement. OK. And if I try to delete a row that do not exits, the result is the same '1'. ¿It is also correct?