delete

CodeIgniter Question: How to delete records using ActiveRecord with mySQL function as WHERE condition

I have a table named ChatSessions where I keep track of active users in the chatroom. I need to prune expired user sessions from the table every 10 minutes. Using pure php-mysql is plain simple but I'm totally clueless how to convert this into ActiveRecord in CodeIgniter. The plain SQL query is below: SELECT * FROM `ChatSessions` WHERE ...

SQL trigger for audit table question

I am writing a trigger to audit updates and deletes in tables. I am using SQL Server 2008 My questions are, Is there a way to find out what action is being taken on a record without going through the selection phase of the deleted and inserted tables? Another question is, if the record is being deleted, how do I record within the au...

bat script to delete file older than 7 days

hi guys i have a bat script in which gets all files in a folder and then converts this folder with its contents into a one RAR file. This script also adds the current date once it makes a copy and moves it this file into a backup folder, i am planning to have this bat file run by a windows scheduler task every day. My question is there...

Appengine Datastore Record Cannot be deleted or changed

This one is probably an appengine fluke and a bug, but I'd love to hear if anyone has any suggestions. I discovered that a single datastore record is behaving strangely by showing up at the beginning of a query on a datetime field sorted by oldest to newest, although the date was newer than all of the other records. On closer inspection...

Problem in deleting content and displaying all the content in JAVA

Hi, again i'm here with my classes, my software is almost done after finishing last two things i will continue to GUI development. Anyway, here is my code: public class Team { private String clubName; private String preName; private ArrayList<Branch> branches; public Team(String clubName, String preName) { t...

Imaplib: how to delete an email from Gmail?

Hi everyone, I am trying to do something as simple as moving an email from inbox to trash using the imaplib of python. However, I am having some problems and I don't know how to solve them. After connect and login into the server, I select the INBOX mailbox and I get the ids list this way: typ, ids = imap_object.search(None, 'INBOX') ...

CakePHP delete() function is not working

Hello, Im just cracking open cakePHP (v1.3.2). I set it up on my local wamp server, seems to work fine except the delete() function doesn't work. I'm following their blog tutorial exactly, its as simple as it can be so I don't understand why its not working. Heres the function in my PostsController class: function delete($id = NULL) { ...

MySQL delete row after 'expiry'

Hi, I am trying to delete expired entries in a MySQL database, on creation or update a field called lastBeat is updated with CURRENT_TIME and I use the following query to check/delete rows older than 20 seconds: DELETE * FROM rmachines WHERE lastBeat < (NOW() - 20); I have also tried CURRENT_TIME instead of NOW() There are 2 ma...

DQL delete from multiple tables (doctrine)

Need to perform DQL delete from multple related tables. In SQL it is something like this: DELETE r1,r2 FROM ComRealty_objects r1, com_realty_objects_phones r2 WHERE r1.id IN (10,20) AND r2.id_object IN (10,20) I need to perform this statement using DQL, but I'm stuck on this :( <?php $dql = Doctrine_Query::create() ->del...

Testing on blackberry device - adding and removing app multiple times

It would be useful for many people to know how to completely remove an application from your device when testing. I have downloaded my app many times now, and likewise have deleted it many times. The problem is when deleting the app, it does not remove things like the persistent object related to my app, or the images downloaded through ...

Delete page permenetly

Hi I deleted sharepoint page which is based on page layout through browser by going siteactions-->managing content and structure--> pages--> selected the page--> delete(by right clicking). But when I see in the content database still the page is there. Basically I want to delete the content type which I could nt delete as it is being...

Google App Engine - Delete until count() <= 0

What is the difference between these 2 pieces of code? query=Location.all(keys_only=True) while query.count()>0: db.delete(query.fetch(5)) # -- while True: query=Location.all(keys_only=True) if not query.count(): break db.delete(query.fetch(5)) They both work. ...

help with delete where not in query

I have a lookup table (##lookup). I know it's bad design because I'm duplicating data, but it speeds up my queries tremendously. I have a query that populates this table insert into ##lookup select distinct col1,col2,... from table1...join...etc... I would like to simulate this behavior: delete from ##lookup insert into ##lookup sele...

How to free memory in try-catch blocks?

Hi, I have a simple question hopefully - how does one free memory which was allocated in the try block when the exception occurs? Consider the following code: try { char *heap = new char [50]; //let exception occur here delete[] heap; } catch (...) { cout << "Error, leaving function now"; //delete[] heap; doesn't wo...

Deleting a element from a vector of pointers in C++.

I remember hearing that the following code is not C++ compliant and was hoping someone with much more C++ legalese than me would be able to confirm or deny it. std::vector<int*> intList; intList.push_back(new int(2)); intList.push_back(new int(10)); intList.push_back(new int(17)); for(std::vector<int*>::iterator i = intList.begin(); i ...

C++: How to clean up a vector/map properly

Hi, If I have a vector<string*> *vect or a map<pair<string*, int*>, string*> *map, how to clean up everything (including all object the vector/map contains)? (Everything (vector, map, contents, string, ints) is allocated with new) Is delete vect; delete map; enough? ...

How to delete an object by using PK in nhibernate?

How do I delete an object without fetching it from the db first? In another ORM, I can do this: session.Delete<User>(1); // 1 = PK ...

how do i check if multiple folders exist if so delete them on button click?

hi i have a few folders created by my application and id like that when they click a button named "clean up" that it would check to see if any of the predetermined folders exist, if they do then delete them, this is what i have tried so far whats wrong with it? string tempFolder = Environment.GerFolderPath(Environment.SpecialFolder....

Can I catch bad pointer errors in C++?

Hi there, I was wondering if there is a possibility to catch errors like this in C++: object* p = new object; delete p; delete p; //this would cause an error, can I catch this? Can I check if the pointer is valid? Can I catch some exception? I know I could set the pointer p to NULL after the first object deletion. But just imagin...

What does it mean if some files in TortoiseSVN are marked "deleted" and others "deleted (+)" with a plus sign?

I'm about to do a commit in TortoiseSVN involving rearranging a lot of files and directories. On the "commit" window, there are several files whose text status is "deleted" or "added" but others whose text status is "deleted (+)" or "added (+)". What does the (+) mean? (It's quite difficult to Google for a plus sign, and the word "plus...