Don't DROP for fun, was:Re: [DB-SIG] ANN: mxODBC Version 0.3
Mon, 01 Dec 1997 11:04:20 +0100
Magnus Lycka wrote:
> 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.)
Ooops, don't know if it's specific to my DB, but db.rollback() get's
me the dropped tables back. Shouldn't be mentioning that
drastic example if ROLLBACK doesn't apply in general though, sorry.
> *) 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.
DB-SIG - SIG on Tabular Databases in Python
send messages to: email@example.com
administrivia to: firstname.lastname@example.org