delete

Delete duplicated records from two databases

I manage to identify duplicate records from two different databases: select * from taskperformance a, taskperformance@dm_prod b where a.activityin = b.activityin and a.completiondate = b.completiondate How can I delete duplicated records from b? I tried: delete taskperformance@dm_prod where exist ( select * from ...

How access ActiveRecord::AutosaveAssociation.marked_for_destruction? from within parent model

I have a model, Person, with the following association: has_many :distributions accepts_nested_attributes_for :distributions, :allow_destroy => true validate :distributions_must_total_100 The custom validation currently fails when it shouldn't -- when some of the validations have been marked for destruction -- because they still sho...

Read-only delete problem Zend Row

What causes a row (Zend_Db_Table_Row) to be set to "readOnly?" I'm having trouble deleting rows in a loop: // this is set to some integers $ids = array(); // get the results $results = $table->fetchAll($select); foreach ($results as $result) { $value = $result->value; if (!in_array($value, $ids)) { // throws a "row...

Deleting __MACOSX folder with PHP?

Has anyone had any experience with deleting the __MACOSX folder with PHP? The folder was generated after I unzipped an archive, but I can't seem to do delete it. The is_dir function returns false on the file, making the recursive delete scripts fail (because inside the archive is the 'temp' files) so the directory isn't empty. Any ide...

Nhibernate save update delete relations

Hi, I have a product that has 1 or more product relations. Entities: Product and ProductRelation So product has a property List(Of ProductRelation) Now I have a checkboxlist where I can select a number of products that I want to assign to this product. When I add a new collection of ProductRelations with the new products, It should ...

How to delete files while Traversing folder tree

I am not sure if I am doing this correctly or if my logic is correct. I am trying to go down a folder structure delete files older than a certain number of days, this part I have correctly implemented, delete empty folders. Can all this be done in one loop? Where do I do the folder delete? I want to delete empty folders up to 3 or 4 l...

How to delete in datagrid as well database

protected void ButtonDelete_Click(object sender, EventArgs e) { DataSet ds; if (Session["location1"] != null) { ds = (DataSet)Session["location1"]; //int cnt = ds.Tables[0].Rows.Count; //for (int i = 0; i < cnt; i++) //{ //} foreach (DataGridItem item in DataGrid1.Items) { HtmlInputCheckBox chk = new HtmlInputCheckBox(); chk = (Htm...

MySQL delete all results of sub-query

Tonight may be the night I crack... Okay, so if you would like a back story, look at my previous question I have finally decided that if this is possible, It's not worth the time it will take to figure out, since I really should have had this done before tonight anyway. So I decided to go another route: Figuring out which of my record...

How to fix "containing working copy admin area is missing" in SVN ?

I deleted manually a directory I just added, offline, in my repository. I can't restore the directory. Any attempt to do an update or a commit will fail with : "blabla/.svn" containing working copy admin area is missing. I understand why, but is there anyway to fix this. I don't want to checkout the entire repo and add my changes t...

How can I write a trigger in mysql that after an insert to the table deletes the row?

I've got an after insert trigger that works good. However, I want it to delete the row after it's been inserted and after the main body of the trigger completes. How can I do that? I have a unique id in the table. ...

How to implement cascading deletion of hierarchical data in MySQL?

Hi, I'm working on a project that has categories / subcategories. The database table for this is unique, with the following structure : CREATE TABLE IF NOT EXISTS `categories` ( `id` int(11) NOT NULL auto_increment, `publish` tinyint(1) NOT NULL default '0', `parent_id` int(11) NOT NULL default '0', `description` text NOT NULL,...

MySQL Auto Increment Values After DELETE without WHERE

i noticed after i ran DELETE FROM tablename my ID (auto increment) valus became weird 7, 8, 9, 0, 1, 12, 3, 4, 15 in this order when i do a SELECT * FROM tablename i know that the certification guide says that IDs may or may not be reset when DELETE without WHERE is used to empty a table, but what caused the ID sequence to be s...

cvs admin delete revisions

Hi, I have a CVS repository with branches and tags. I want to delete all the revisions and to keep only the latest revision of the trunk and the latest in every branch. I'm familiar with the "-o" command but I don't quite understand. I've read about it but I could use some help with the command. Thanks, Oded. ...

How to delete a file which is locked?

I am writing a desktop application under Windows in C++ MFC. The application creates a index file, and writes information to it again and again. If the application crashes, the next time the application starts it will delete the crashed index file and create a new one. I think in certain cases, the index file will be locked. It will be...

How can I search for and delete an array element in PHP?

I have a PHP array that looks like this: Array ( [0] => Array ( [start] => DateTime Object ( ) [end] => DateTime Object ( ) [comment] => A comment. ) [1] => Array ( [start] => DateTime Object ( ) [end] => DateTime Object ( ) [comment] => Another comment. ) ) I would like to create a function that...

NHibernate.ISession.Flush() is taking a long time after a Delete()-Operation

In my application I would like to clear/empty a table (which is the only one) in my SQLite-DB. I am programming in C#. _session is of type NHibernate.ISession. Here is my code: string queryFmt = "FROM {0}"; string query = String.Format(queryFmt, typeName); _session.Delete(query); _session.Flush(); My example-DB consists of over 5000 e...

Send the whole Form data with delete click

Hi Guys, I have a Delete button on Edit Form Mode. I want to send the whole form data to the controller when this button is clicked in Edit mode. I have a ViewModel on View which has data in it and displayed to user with input fields. Now if user clicks Delete then this whole data needs to be sent to controller. This is my delete metho...

how can delete a binary tree node with all possibility?

i created a binary tree with some integer values ...i can search the tree by my code ,but i dont know how to proceed delete node operation ..help me with simple program using c..thanks in advance....... ...

Delete a macro in Notepad++

I have a macro in Notepad++ that I don't use anymore, the macro also uses a shortcut I want to use for other macro's. But there seems to be no function in Notepad++ to delete macro's. Is there a more difficult way to delete macro's in Notepad++ (for instance manipulating the setting-files of Notepad++)? ...

Python MySQL - SELECTs work but not DELETEs?

Hey -- I'm new to Python and Python's MySQL adapter. I'm not sure if I'm missing something obvious here: db = MySQLdb.connect(# db details omitted) cursor = self.db.cursor() # WORKS cursor.execute("SELECT site_id FROM users WHERE username=%s", (username)) record = cursor.fetchone() # DOES NOT SEEM TO WORK cursor.execute("DELETE FROM ...