Re: Do we always have to update or insert? Why can't we just relate?

From: David Cressey <david.cressey_at_earthlink.net>
Date: Wed, 19 Oct 2005 10:00:09 GMT
Message-ID: <JOo5f.16459$vw6.2781_at_newsread1.news.atl.earthlink.net>


"Gene Wirchenko" <genew_at_ucantrade.com.NOTHERE> wrote in message news:itgal15o8jubis079n29491hrgeabfe7e3_at_4ax.com...
> On Tue, 18 Oct 2005 07:49:16 +0100, "Roy Hann"

> You do not. Error message or not, the result (the contents of
> the database) is the same, but the error message gives a bit more
> information.

You can give the same information without raising an error flag. In programmed access to SQL,
there is a data area where such things as a row count are normally included.

Consider once again a DELETE with a where clause that rules out all the existing rows.

SQLCODE= 0
ROWCOUNT= 0 The programmer has the information that nothing went wrong, and also that nothing was deleted.

All most of us are suggesting is that if a row to be inserted matches an existing row that (in the case of a single row insert)

we get the same answer:

SQLCODE=0
ROWCOUNT=0 Nothing went wrong. Nothing has been added.

PS: ROWCOUNT is not the real name of the data item. I've forgotten what it's really called. Been a long time since I accessed SQL from a program. Received on Wed Oct 19 2005 - 12:00:09 CEST

Original text of this message