update multi row when i meant update single row

RGVhciBhbGw6DQoNCkkgdHJpZWQgdG8gdXBkYXRlIGEgc2luZ2xlIHJvdyBmb3IgdGhlIGRh
dGFiYXNlLCBob3dldmVyLCB0aGUgcXVlcnkgaGVyZQ0KdXBkYXRlIG11bHRpcGxlIHJvd3MN
Cg0KbXkgJHNxbCA9ICJVUERBVEUgdXB0aW1lIFNFVCB1cF90aW1lPSRuZXdfdXB0aW1lDQog
ICAgICAgICAgICAgV0hFUkUgaG9zdG5hbWUgPSAnJGhvc3QnIGFuZA0KICAgICAgICAgICAg
IHN0YXJ0ZGF0ZT0gKHNlbGVjdCBNQVgoc3RhcnRkYXRlKSBmcm9tIHVwdGltZSB3aGVyZQ0K
ICAgICAgICAgICAgIGhvc3RuYW1lID0nJGhvc3QnIGFuZCB1cF90aW1lID0gJG9sZHVwdGlt
ZSkgIjsNCg0KSSBtZWFudCBvbmx5IHdhbnQgdG8gdXBkYXRlIGxhdGVzdCBzdGFydGRhdGUs
IHNvbWVob3csIGl0IHJldHVybnMgYWxsDQp0aGUgc3RhcnRkYXRlIHdoaWNoIHVwX3RpbWUg
PSRvbGR1cHRpbWUNCmFuZCB1cGRhdGUgdGhlbSBhbGwuDQoNCkFueSBzdWdnZXN0aW9ucz8g
IFRoYW5rcyBmb3IgYW55IHJlc3BvbnNlcyENCg0KZG9uZw0K
0
xdong
4/17/2001 8:47:52 PM
perl.dbi.users 11100 articles. 1 followers. Follow

2 Replies
713 Views

Similar Articles

[PageSpeed] 55

----- Original Message ----- 
From: Xiaoxia Dong <xdong@aer.com>
To: <dbi-users@perl.org>
Sent: Tuesday, April 17, 2001 10:47 PM
Subject: update multi row when i meant update single row


> Dear all:
> 
> I tried to update a single row for the database, however, the query here
> update multiple rows
> 
> my $sql = "UPDATE uptime SET up_time=$new_uptime
>              WHERE hostname = '$host' and
>              startdate= (select MAX(startdate) from uptime where
>              hostname ='$host' and up_time = $olduptime) ";
> 
> I meant only want to update latest startdate, somehow, it returns all
> the startdate which up_time =$olduptime
> and update them all.
> 
> Any suggestions?  Thanks for any responses!
> 
Hmm, it seems that it only should update all rows if startdate is the same.
In what statement is startdate set?
Not in this one.
Could it be that all the rows contain the same startdate (e.c. NULL) ?


0
m
4/17/2001 9:15:35 PM
> -----Original Message-----
> From: Xiaoxia Dong [mailto:xdong@aer.com]
> Sent: Wednesday, April 18, 2001 6:48 AM
> To: dbi-users@perl.org
> Subject: update multi row when i meant update single row
> 
> 
> Dear all:
> 
> I tried to update a single row for the database, however, the 
> query here
> update multiple rows
> 
> my $sql = "UPDATE uptime SET up_time=$new_uptime
>              WHERE hostname = '$host' and
>              startdate= (select MAX(startdate) from uptime where
>              hostname ='$host' and up_time = $olduptime) ";
> 
> I meant only want to update latest startdate, somehow, it returns all
> the startdate which up_time =$olduptime
> and update them all.
> 
> Any suggestions?  Thanks for any responses!
	
There are two queries compounded in this statement. What do they each return
as a select statement. ie If the subquery is only returning one value,
select the rows of uptime, startdate and display them.

> 
> dong
> 

__________________________________________________________________________
Please Note :
Only  the intended recipient is authorised to access or use this e-mail.  If
you are not the intended recipient,
please delete this e-mail and notify the sender immediately.   The contents
of this e-mail are the writer's 
opinion and are not necessarily endorsed by the Gunz Companies unless
expressly stated.

We use virus scanning software but exclude all liability for viruses or
similar in any attachment.


0
neillunn
4/17/2001 10:47:34 PM
Reply:

Similar Artilces:

Row updating, row updated confusion
Okay this is the first time I've ever had to do code behind for row updating logic in a gridview. So be patient with me if it's totally incorrect. Do I put the gridview rebind code in the Row Updating or Updated event?  Currently, I have it in both as I'm simply troubleshooting to try to get it to work.  With this code, not only is the record not updating but the record disappears from the gridview upon refreshing.Protected Sub GridView2_RowUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdatedEventArgs) Handles GridView2.RowUpdated ...

question about updating a row? How to update a different row.
I will try to make this as simple as I can. k, here I go. I originally populate my datagrid with data. Then during the edit mode, I can populate information by an ontextchanged event, which is actually bringing in a new row (essentially). My problem occurs when I try to update the data. Since the row was originally populated with the data, it updates that row in the table. But since I did an ontextchanged, I want to update that row instead. Not the original row. If I do an update, then I have two identical rows of data in my table, but with different primary keys. How can I update t...

warning: update row ... is a conflict update and this row is ignored
SQL Anywhere 10.0.1.3488 I am synching one SQL Anywhere database to another through MobiLink, getting this warning: W. 2008-08-19 13:01:01. <17> [10037] Ignoring updated row (new values) W. 2008-08-19 13:01:01. <17> [10038] Ignoring updated row (old values) W. 2008-08-19 13:01:01. <17> [10072] The update row for table '<orders>' is a conflict update and this row is ignored. There are currently no conflict resolution scripts in place, so I would expect the default behavior of "last one in wins" rather than seeing "this row is ign...

Multi-row Update() affects one row in a DataStore
Hi, PB 8.0.1 8004 To enable updating multiple master-detail entry datawindows, I developed a mechanism that first makes deletes and then inserts and updates to ensure not violating database referential integrity rules. In the delete phase, I RowsCopy the deleted buffer to a datastore, and then update. In the insert and update phase, one by one I RowsCopy the modified rows (newmodified and datamodified) to a datastore and then make necessary SetItemStatus calls for the row and each column on that row. Finally after building the secondary datastore, I issue an update statement. ...

How can you make a single update button, that updates all rows in datagrid
I have a datagrid that is editable, currently every row is editable , but each row has to click save for the row to be updated. My customer wants a single button that will update all rows. Currently i have an button column ith an update hyperlink which has a command name puttin it into edit mode. From there when they click save, I can access that row thorugh the item item command action of the data grid. If anyone knows, please help What you have to do is define an ItemTempate that contains controls that are currently defined in the EditTemplate. This way all the rows of the grid ...

DataSet rows being deleted, but after the update , the sql database is not updated. The delete rows still in the database.
 Stepping thru the code with the debugger shows the dataset rows being deleted.   After executing the code, and getting to the page presentation. Then I stop the debug and start the page creation process again ( Page_Load ).    The database still has the original deleted dataset rows. Adding rows works, then updating works fine, but deleting rows, does not seem to work.   The dataset is configured to send the DataSet updates to the database. Use the standard wizard to create the dataSet.     cDependChildTA.Fill(cDependChildDs._ClientDependentC...

how to update a row using a seperate update button not command button without selecting the row?
How to update a row using a seperate update button not command button without selecting a row? Simple question but dificult to do. The reason I ask this is that when a user clicks 'Update' I want each row to update the database. Please note I can't use findcontrol as their are no headers This is my code so far: protected void UpdateButton_Click(object sender, EventArgs e){    foreach (GridViewRow row in CellGridView.Rows)     {          string stext = CellGridView.Rows.ToString();     &nb...

updates, updates, updates, NO MORE!
Name: Andreas Email: unbekanntatjokerdotms Product: Firefox Summary: updates, updates, updates, NO MORE! Comments: Hi ! if you want to develop a fine webbrowser, maybe you nee a new management. To release a new buggy version every two weeks is not very professional. Test your software before the release and let the user download a stable browser. this update-orgy since 2.0.0 used me to use Opera instead of FF. We haved use FF in our Company, but we can't deploy a new version every week to +200 Windows-clients, so in our company we've decided to return to IE, ...

Updates Updates Updates
I was a big fan of Firefox.. Now, I don't even like to use it. Seems like every time I start it up I have to update some addin OR the browser itself. And unfortunately the update nag messages are always presented when I start a browsing session. I find this annoying because, typically, when I open a web browser all I want to do is go to a web page. Not update the browser. I can agree that staying current with the latest version could give the best, fastest, safest web experience. But that point becomes mute when I start off every other browsing session with a new update. And mos...

updates, updates, updates
Name: hans jensen Email: hansjensen44_athotmaildotcom Product: Firefox Summary: updates, updates, updates Comments: why is it everytime i go online firefox has new updates, 3 -4 times every day, its never ending..........whats all the problems??? please email me and let me know, ty,.........Hans Jensen Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2 ...

Updates, updates and more updates
Name: pirhan Email: pirhan_chanathotmaildotcom Product: Firefox Summary: Updates, updates and more updates Comments: Hello, Normally I use Safari, but my iBook is out of commission for a while. So, I am forced to use a PC to which I would much rather use Firefox than Internet Exploder. However, as much I enjoy not using a Microsoft product, and use a product that works decently, I am severely annoyed about the constant updates I am put through. In the last two days, I had to wait for Firefox to install updates before I could browse and now, I'm alerted that there'...

Update Command Updates All Rows
I have a gridview update issue. I want to update just two fields "Email" and "IsLockedOut". However, when I press update all the rows are updated with the same information. I would like just the row that was in edit mode to be updated. My code is as follows:<asp:SqlDataSource ID="dbAdmin" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [vw_aspnet_MembershipUsers] ORDER BY [UserName]" OnSelecting="dbAdmin_Selecting" UpdateCommand="UPDATE as...

updates, updates, updates
Holy Crap, Batman! You'd think I was running Windows XP and it's patch Tuesday. So far this week - new kernel (2.6.27.10), 2 new browsers (Opera 9.63 and Firefox 3.05) and a new plugin (Flash 10.0.156.3). I'm about ready to try one od the BSD's! vince wrote: > Holy Crap, Batman! You'd think I was running Windows XP and it's patch > Tuesday. > > So far this week - new kernel (2.6.27.10), 2 new browsers (Opera 9.63 > and Firefox 3.05) and a new plugin (Flash 10.0.156.3). I'm about ready > to try one od the BSD's! I take ...

Updating only updated DataGrid rows
I have a gridview control that I have  swapped out the lable controls for textbox controls. What i want to do is code a save button to iterate through the rows and at any row where the value has been changed, run a sql update. I have the sql, I have the grid view, but i dont have the iteration code. (im using c#)psudo code:  while(gridview.rows.morerows()=true (or somthignlike that))if(row.current row.update = true ){do sql update here}nextRow Any hints are greately appreciated Dan    foreach (GridViewRow row in GridView1.Rows) { // You hav...

Web resources about - update multi row when i meant update single row - perl.dbi.users

Saturday Night Live Weekend Update Thursday - Wikipedia, the free encyclopedia
Saturday Night Live Weekend Update Thursday is an American limited-run series broadcast on NBC . It is a political satire news show spin-off ...

Gizmodo.com Updates
Nobody should have to use a pay phone , natural disaster or no natural disaster. So if your gadgets are out of juice after Sandy, here’s a tiny ...

Lifehacker.com Updates
By Whitson Gordon Ever run into a situation where you have multiple wireless networks available, but one is clearly better than the other? WiFi ...

Facebook Messenger For Android Update Includes Conversation Shortcuts
Facebook released an update to its Android Messenger application that incorporates the group -creation and message forwarding features in last ...

China Mobile (Hong Kong) Ltd. Analyst Ratings Update
China Mobile (Hong Kong) Ltd. Analyst Ratings Update American Trade Journal Research firm Zacks has rated China Mobile (Hong Kong) Ltd. (NYSE:CHL) ...

Windows 10 Mobile Update For Older Lumias Pushed To 2016
... the roll out of Windows 10 Mobile to existing Lumia devices in December. With December being half over by this point, the fact that the update ...

Microsoft updates OneDrive with Spotlight search and offline file support
Microsoft has recently pushed a couple of updates to the official iOS app of its cloud storage service , OneDrive , thereby introducing a couple ...

***Live Updates*** Democrats Debate in New Hampshire
The first college football bowl games are being played tonight. The Dallas Cowboys and the New York Jets will play in this season’s first NFL ...

Market update, December 18 - Business Insider Deutschland
Stock futures are lower and crude oil is near the lowest levels since early 2009.

Fire Alarm Clears L.A. Theater Showing ‘Force Awakens’; LAFD Reports False Alarm – Update
UPDATED, 8:50 PM: According to social media reports, moviegoers who were evacuated from Pacific Theatres at the Grove were allowed back in, and ...

Resources last updated: 12/20/2015 8:16:42 AM