~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/replace.rst

  • Committer: Brian Aker
  • Date: 2011-02-22 06:12:02 UTC
  • mfrom: (2190.1.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110222061202-k03czxykqy4x9hjs
List update, header fixes, multiple symbols, and David deletes some code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Replacing Data
 
2
==============
 
3
 
 
4
In Dizzle you can make use of REPLACE to insert a new record into a table or
 
5
delete and insert a record in a table if a record matching the primary key
 
6
already exists. If no primary key or unique constraint is found on the table
 
7
then REPLACE is equivalent to INSERT.
 
8
 
 
9
A typical query:
 
10
 
 
11
.. code-block:: mysql
 
12
 
 
13
   REPLACE INTO table_1 SET a=5;
 
14
 
 
15
or
 
16
 
 
17
.. code-block:: mysql
 
18
 
 
19
   REPLACE INTO table_1 VALUES (4);
 
20
 
 
21
 
 
22
REPLACE is an extension to the SQL Standard that first appeared in MySQL.