pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gabriel López Millán <gabilm@dif.um.es>
To: Bob Kline <bkline@rksystems.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: DELETING ROW
Date: Thu, 13 Jul 2000 09:49:57 +0200
Message-ID: <396D74A4.DC1E2536@dif.um.es> (raw)
References: <Pine.LNX.4.10.10007120940000.19236-100000@rksystems.com>

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?




view thread (4+ messages)  latest in thread

Message-ID: <396D74A4.DC1E2536@dif.um.es>
Permalink:  ../396D74A4.DC1E2536@dif.um.es/
Also on:    postgresql.org/message-id/396D74A4.DC1E2536@dif.um.es

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: gabilm@dif.um.es, bkline@rksystems.com
  Subject: Re: DELETING ROW
  In-Reply-To: <396D74A4.DC1E2536@dif.um.es>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox