Existence Of Data
From: Heather Dyson <heather.dyson_at_template.com>
Date: 1995/12/07
Message-ID: <4a72a4$6fc_at_template.com>#1/1
Date: 1995/12/07
Message-ID: <4a72a4$6fc_at_template.com>#1/1
I am writing a program where I get some data and need to determine whether to do an update or an insert. So I have to check to see if the row already exists, if it does I do an update otherwise I insert.
Is the best way to check for existence to do the following sql statement:
select <fields> from <table> where <primary key> = <value>;
Then if a row comes back I do an update and if no row comes back I do an insert. Or does anybody have a better way to check for existence? Received on Thu Dec 07 1995 - 00:00:00 CET