ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 20th, 2004, 01:28 AM
crisies crisies is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 crisies User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 20 sec
Reputation Power: 0
Exclamation Affected Rows on Update in MySQL

Hello everyone

How can I retrieve the amount of changed Records on an update in MySQL-Tables? In PHP for example, ther's a function named "affected_rows()", is there something similar for ColdFusion or do we have to resolve this problem over storedprocedures.

I only have to know if an update was made or not, it isn't important to know the exact amount of the affected rows.

thanks a lot in advance
chris.w.

Reply With Quote
  #2  
Old July 20th, 2004, 02:41 AM
crisies crisies is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 crisies User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 20 sec
Reputation Power: 0
Post Workaround...

anyone who is interested to solve that problem, I've found a solution. But the only way to get the affecte_rows, is to work with the java-native-database-driver and the cfscript-tag.

Example:
URL

Reply With Quote
  #3  
Old July 20th, 2004, 10:44 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,626 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 6 m 34 sec
Reputation Power: 53
For most RDBMS's, stored procs are the best way to get data back regarding DML queries (insert, update, delete).

That said, some support getting this info back natively (SQL Server, Oracle, etc...obviously MySQL does as well) For example, you can get the id of the row just inserted from SQL Server by returning @@IDENTITY. But this is all DB-specific.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Affected Rows on Update in MySQL


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway