Don't DROP for fun, was:Re: [DB-SIG] ANN: mxODBC Version 0.3
Sun, 30 Nov 1997 22:46:18 +0100
At 12:51 1997-11-29 +0100, M.-A. Lemburg wrote:
>The DB API gave me the impression that you'll always have to
>explicitly call .commit() to get your changes committed. Now what
>if someone else also gets this impression and then drops some
>tables just for the fun it... I'm sure he'd get into a lot of
>trouble, if the module would have autocommitted his requests.
Ouch! He would anyway!
SQL is divided into two parts: The data definition languages (DDL)
and the data manipulation language (DML) *). The DDL consists of
statements that define the database structure such as CREATE and DROP.
The DML consists of the statements used in changing and querying
database content such as INSERT, UPDATE, DELETE and SELECT.
COMMIT and ROLLBACK (and sometimes SAVEPOINT) are used to make
multiple DML statements into a single transaction. They do NOT
regulate DDL statements. Your DROP TABLE happens at once! At least
with the databases I've worked with. (I just tested with Oracle.)
*) Some people would even say that queries aren't manipulation (and
I guess that is true) and say that data query language (DQL) is
something separate. I.e. SELECT would be DQL, not DML.
Magnus Lycka, S/W Engineer, M.Sc.E.E; Folktrov. 6C, 907 51 Umea, Sweden
Tel: +46(0)90 198 498, GSM: +46(0)70 582 80 65, Fax: +46(0)70 612 80 65
DB-SIG - SIG on Tabular Databases in Python
send messages to: firstname.lastname@example.org
administrivia to: email@example.com