On Tue, 28 Nov 2006, Craig Morrison wrote:

Another method is to have a field declared UNIQUE and use the syntax:

INSERT OR REPLACE INTO table ...

The UNIQUE constraint will trigger the REPLACE constraint if it already exists and the row will get updated instead of inserted.

Craig,

  What I'm working on now is the general project database description. The
schema for table 'model' is:

CREATE TABLE model (model_name text not null primary key, model_desc text,
model_type text, keName text, agent INTEGER);
CREATE INDEX model_name_idx on model (model_name);

  The index is, I believe, redundant as the column is the primary key so
it's both unique and indexed.

  Do I need to specify each field as unique for this to work? Perhaps part
of my problem is that I'm not getting the database connection to work
properly so I cannot test it in real time. One step at a time.

Thanks,

Rich

--
Richard B. Shepard, Ph.D.               |    The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)    |            Accelerator
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to