Hey there,
sorry , second question in as many days.
i am trying to do some stuff with MySQLdb and the thing is, i can
select records and such, but when i try to delete them, they dont
really go away.
like this cursor.execute("DELETE FROM table WHERE autoinc > 1000")
240L cursor.execute("SELECT * FROM table WHERE autoinc > 1000")
0L
so it looks like it worked, but when i use something else to look at
the
table (phpmyadmin, mysql-query-browser, knoda) the records are still
there!
what do i do? 8 1999
On 27 Jul 2005 04:29:33 -0700, ne*****@xit.net <ne*****@xit.net> wrote: Hey there, sorry , second question in as many days. i am trying to do some stuff with MySQLdb and the thing is, i can select records and such, but when i try to delete them, they dont really go away.
A fiver says you need to commit your changes.
--
Cheers,
Simon B, si***@brunningonline.net, http://www.brunningonline.net/simon/blog/
Simon Brunning wrote: On 27 Jul 2005 04:29:33 -0700, ne*****@xit.net <ne*****@xit.net> wrote:
Hey there, sorry , second question in as many days. i am trying to do some stuff with MySQLdb and the thing is, i can select records and such, but when i try to delete them, they dont really go away.
A fiver says you need to commit your changes.
ok, do i do that with cursor.commit() ?
thanks
nephish wrote: Simon Brunning wrote: On 27 Jul 2005 04:29:33 -0700, ne*****@xit.net <ne*****@xit.net> wrote:
Hey there, sorry , second question in as many days. i am trying to do some stuff with MySQLdb and the thing is, i can select records and such, but when i try to delete them, they dont really go away. A fiver says you need to commit your changes.
ok, do i do that with cursor.commit() ? thanks
Yes, or maybe you should write a lightweight layer between the dbapi and
your program which can turn on and off the autocommit by calling
"commit" and "begin" as query. I did this in my pgsql layer. Using
transactions every time is almost as bad as never using them.
Mage
ok. did this cursor.execute("DELETE FROM table WHERE autoinc > 1000")
245L cursor.commit()
i got an AttributeError 'Cursor' object has no attribute 'commit'
hmm. what should i do now?
the stuff about writing a lightweight layer between the dbapi and the
program shot right over my head. sorry, but thanks ne*****@xit.net wrote: ok. did this
cursor.execute("DELETE FROM table WHERE autoinc > 1000") 245L cursor.commit()
i got an AttributeError 'Cursor' object has no attribute 'commit'
hmm. what should i do now? the stuff about writing a lightweight layer between the dbapi and the program shot right over my head. sorry, but thanks
IIRC it is the connection that can commit(), not the cursor.
Rowdy
Man, thanks for the link. and the tip. i am testing
the db.commit() and printing the doc right now.
thanks again.
On 07/27/2005 07:43:24 AM, Rowdy wrote: ne*****@xit.net wrote: ok. did this
> cursor.execute("DELETE FROM table WHERE autoinc > 1000")
245L
> cursor.commit()
i got an AttributeError 'Cursor' object has no attribute 'commit'
hmm. what should i do now? the stuff about writing a lightweight layer between the dbapi and the program shot right over my head. sorry, but thanks
IIRC it is the connection that can commit(), not the cursor.
Rowdy
nephish wrote: Man, thanks for the link. and the tip. i am testing the db.commit() and printing the doc right now. thanks again.
If it's any help, using
cursor.execute("set autocommit = 1")
before doing anything else works nicely unless you actually need
transactions.
The Cog This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Tony Clarke |
last post by:
Hi,
Just a quick question about performance with MySQL & PHP. If I had a table
in a MySQL database with about 100,000 records in it and I need to find the
last record is there a quick way to do...
|
by: Karam Chand |
last post by:
Greetings
I manage a website wherein i keep track of the people
email who have downloaded my software and the version
number.
the structure is like -
id int auto_increment primary key,...
|
by: Mark Jay Johansen |
last post by:
Does anyone know what the relative performance would be of using updateable
result sets versus using individual insert or update statements?
(Specifically at the moment I'm dealing with JSP...
|
by: R. Tarazi |
last post by:
Hello,
DB-structure:
=========
firmendaten
-----------------
firmendatenid <-
firmennummer
name
strasse
|
by: Danny J. Lesandrini |
last post by:
I know this has been discussed before, as I've seen the Google posts,
but they all leave me with an unanswered question:
Does my DAO code executed in the front end cause the back end to bloat?...
|
by: (PeteCresswell) |
last post by:
I've got apps where you *really* wouldn't want to delete certain items by
accident, but the users just have to have a "Delete" button.
My current strategies:
Plan A:...
|
by: azmiza |
last post by:
Hi everybody,
I need your help.
I want to view my sql database and its work very well which is display in my web browser
but once I want to press button yes, its not working, I check the...
|
by: JohnO |
last post by:
Hi All,
This question is related to iSeries V5R4 and db2.
I want to implement an AFTER DELETE trigger to save the deleted rows
to an archive table, I initially defined it as a FOR EACH...
|
by: pitjpz |
last post by:
We have moved our Database to another server. The server it was on used SQL 4 and the new one its on now uses SQL5
the only problem we can find is that when you attempt to delete a record from...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |