update

How the schema migration tools work?

I have db based application and I delete the schema & db content every time whenever there is any changes in the schema. Now it is in development mode. Soon we release the application in production. But we suspect there could be many changes after we release the application in production use. The software shall be installed on many loca...

Update query with 'not exists' check causes primary key violation

The following tables are involved: Table Product: product_id merged_product_id product_name Table Company_Product: product_id company_id (Company_Product has a primary key on both the product_id and company_id columns) I now want to run an update on Company_Product to set the product_id column to a merged_ product_id. This update co...

mySQL updating but also not updating

I am writing in mySQL/PHP, but have this problem I cannot get my head around. This one PHP script contains two SQL statements. What I am trying to do is update a sports league table (a SQL table called tblrank - which contains many league tables, separated by TableID), and to indicate if the team has gone up or down since the last time i...

SVN update after custom patch

I have this scenario. I checked out a code for one project from a public official SVN repository. Then I applied a custom patch from another source which changed quite a few files. Now and then official repository gets updates since active developers are committing code there. In order to keep up to date with them I do SVN update. My q...

slow update after pipe, stout, stderr redirection and saving file at the same time

I'm saving the output of a command after redirecting its stdout, stderr and passing it through a pipe. Things seem to be working fine but I'm noticing a delay in bash screen update which is almost <= 37 seconds. The same delay I see when checking output file with "tail -f output-ping.txt". I've never seen such a delay earlier even with...

DataGrid (WinForm) - Error while Data Source is updated

Now, i am working in .NET FX 1.1 C# windows application. For doing data bound, i am using "DataGrid" control (due to missing of DataGridView in Fx 1.1). In this, we are binding "DataTable" object to DataGrid's DataSource. It is showing fine. Problem is, i am getting error messages, "while inserting additional data to a DataTable which ...

MySQL grouping columns

is there any way i can group several of my columns together? in one for my scripts i need to set several of my columns to the same value, is there a better way than typing out all the column names in my update query? thanks ...

Basics rules on UPDATE statement for relational MySql table: for vs while

Hello, I'm doing my first steps with mysql and php, so I have doubts on foundamental rules for a right code optimization. I have a case where my UPDATE statement need to be executed on a certain number of rows, because it should be executed on a relational table, so is a for cicle correct? <? // connection already created $data[] = arr...

How to update ASP.NET image periodically using image processing page?

Hi, I develop an ASP.NET three-tear web application. The server side receives a stream of image data (JPEG frames as byte arrays). It processes them and sends the images to the client side periodically. For displaying these images on the client side I tried to use an approach similar to this described in the post “Improve your Imag...

code igniter update a row using active records

hi All programmer I wanted to update a row using active records in codeigniter, and I only want to increment a field value (received_qty = received_qty +1) , I realized that I can do that in usual sql, but I cant in codeigniter active records $update['received_qty'] = 'received_qty + 1'; $update['received_date'] = date("Y-m-d"); $this-...

Android Widget Not Updating

I am trying to implement a simple widget for display on the home screen. The problem I am experiencing is that onUpdate is only being called once when I install the widget. The configuration is below. Note: I will not leave update period at 20 secs as I know that would kill battery (just testing). Configuration: `<appwidget-provider xm...

Update multiple columns in SQL with bound multi-part identifier

I'm trying to update multiple columns in a MS SQL statement using a sub-query. A search led me to something like: UPDATE table1 SET col1 = a.col1, col2 = a.col2, col3 = a.col3 FROM (SELECT col1, col2, col3 from table2 where <expression>) AS a WHERE table1.col1 <expression> http://geekswithblogs.net/phoenix/archive/2009/10/13/update-mu...

Mysql Clone Row With Primary Key

I have a Mysql table with a single primary key (called pkey) that auto increments, and I would like to clone one row, keeping all the data the same, except for the primary key which should become the next available value as defined by auto increment. My first question is, is the following query possible? UPDATE `table` SET pkey='next_a...

update statement in sql server 2005

Consider the following Dig, Assume that all the three tables have a column Is_Deleted by default it is set to 0... I want to update Is_Deleted=1 field of Customers table where CustId=2 only when the rows containing CustId=2 and Is_Deleted=1 in Orders and OrderItems Tables... I dont want to use Cascade option.. Any suggestion ...

DefaultButton="InsertButton" on <asp:ListView>

In a when there are no rows and user enter values and hit Enter after last value then new row is inserted (like it should be) But then the Delete button of the first row become the default button for the ListView and when user hit Enter on following rows first row in ListView is deleted. I have tried to use surrounding both the ItemT...

Update a foreign key in Entity Framework

Hi! I have created a partial class of an entity for getting a foreign key property on it. public partial class Artikel { public int WarengruppenID { get { if (WarengruppeReference.EntityKey == null) return 0; return (int)WarengruppeReference.EntityKey.EntityKeyValues[0].Value; } ...

jQuery: val() updated too late

UPDATE: there was a problem with some other code. I'm trying to get the value of some input text field. The problem is that the value I obtain by my_val = $('#MyInput').val(); is not really updated. If I write in the field 'foo' and then click on the element which triggers the script, then I get my_val = undefined. On the other han...

MySQL conditional UPDATE using IN

I have a database table with a column named featured which is used to highlight featured content on a page. Currently, I'm using two SQL statements to toggle the featured rows on/off like so: -- Reset everything to non-featured UPDATE tbl SET featured = '0'; -- Now set the selected rows as featured. UPDATE tbl SET featured = '1' WHERE...

How to link sql database entries?

I have a SQLite database of notes that have columns _id, title, details, listid _id is the auto incremented primary key title and details are string data fields listid is a foreign key pointing to a list name in another table. I'd like to find a way to have notes that are in multiple lists or notes that are linked in such a way tha...

MySQL Update Serialized Data

How to update serialized data in DB Table field? I want to store serialized data to reduce count of queries but don't have idea how to update them. ...