This is probably a dumb question, but are you running all the queries in
eod_stocks?  I ran all the queries and they worked fine.  I undotted the
select though because my database was not called eod_stocks.  Since you did
not include the part where you select the database to run these queries in,
one cannot assume you are creating, deleting and inserting into the same
database you are selecting from, since the select is not defaulting to the
selected DB.

-----Original Message-----
From: Mudit Wahal [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 04, 2003 8:03 PM
To: [EMAIL PROTECTED]
Subject: insert after delete is not atomic


>Description:
        I have a delete statement and an insert statment. I'm replacing a line but
I want
        to make sure, that its deleted. The insertion is successful as per sql
batch output.
        But when I dump the data from the table, there is no record for the date !
Seems like
        delete operation happened after the insert.

>How-To-Repeat:
        SQL Input Script
        ================================
        create  table if not exists MSFT (date DATE not null, close DECIMAL(10,2),
high DECIMAL(10,2), low DECIMAL(10,2),
        volume MEDIUMINT, yest DECIMAL(10,2), PRIMARY KEY date (date));
        delete from MSFT where date='2003-02-04';
        insert ignore into MSFT
Values('2003-02-04','47.3200','47.9400','46.8800','406440','47.8000');

        ===============================

        SQL Output from the script
        ===============================
        --------------
        create  table if not exists MSFT (date DATE not null, close DECIMAL(10,2),
high DECIMAL(10,2), low DECIMAL(10,2),
        volume MEDIUMINT, yest DECIMAL(10,2), PRIMARY KEY date (date))
        --------------

        Query OK, 0 rows affected (0.00 sec)

        --------------
        delete from MSFT where date='2003-02-04'
        --------------

        Query OK, 0 rows affected (0.01 sec)

        --------------
        insert ignore into MSFT
Values('2003-02-04','47.3200','47.9400','46.8800','406440','47.8000')
        --------------

        Query OK, 1 row affected (0.02 sec)
        ------------------------------------------
        SQL Output from query for the date 2003-02-04
        ===============================
        mysql> select * from eod_stocks.MSFT where date = '2003-02-04';
        Empty set (0.01 sec)




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to