"Fossies" - the Fresh Open Source Software Archive

Member "drizzle-7.1.36-stable/docs/replace.rst" (6 May 2012, 513 Bytes) of package /linux/misc/old/drizzle-7.1.36-stable.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

Replacing Data

In Dizzle you can make use of REPLACE to insert a new record into a table or delete and insert a record in a table if a record matching the primary key already exists. If no primary key or unique constraint is found on the table then REPLACE is equivalent to INSERT.

A typical query:

REPLACE INTO table_1 SET a=5;

or

REPLACE INTO table_1 VALUES (4);

REPLACE is an extension to the SQL Standard that first appeared in MySQL.