In SQL Server you would return the  @@rowcount like the following
 
DECLARE @myCount INT
 
SET @myCount =  @@rowcount
 
And make sure you pass the variable out
 
-----Original Message-----
From: Barry Beattie [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 16 June 2004 10:24 AM
To: CFAussie Mailing List
Subject: [cfaussie] returning number of rows affected (updates, deletes)

Hi all.

 

I’m looking for a way to return the number of rows affected on updates and deletes

 

kind of like this

http://www.tek-tips.com/gfaqs.cfm/pid/183/fid/761

(Obtain "Rows Affected" by Execution of a Dynamic SQL Statement)

 

but the db isn’t SQLServer, I can only use CFQUERY (no stored procs) , etc.

 

eg:

<cfquery name="test" datasource=”blah”>

            update paststudent

            set GIVEN_NAME = "Zoe-e"

            WHERE GIVEN_NAME = "Zoe" and SCHOOL_SURNAME = "Zorpund"

</cfquery>

<cfoutput>#test.recordcount#</cfoutput>

 

which of course throws an error, since no actual records are returned.

 

I know the db (Informix) can return a struct containing things similar to SQLServer’s @@rowcount, @@error, etc, but how to access that from CF is the bit I’m stuck on.

 

 

any ideas?

 

 

thanx

Barry Beattie

CF Web Developer

Alpha Business Systems

[EMAIL PROTECTED]

 

Ph: +61 07 3216 0999

 

Unit 1, 31 Thompson Street

Bowen Hills QLD 4006

www.alphabus.com.au

 

Virus Disclaimer: Please note that this email may contain computer-generated file(s) as an attachment.  Whereas we take every effort to protect our files from computer virus, we recommend that you check the file(s) with your own virus detection software prior to opening it.  If you would prefer to receive a hardcopy of the file please email or phone. Alpha Business Systems does not accept liability for the consequences of any computer viruses that may be transmitted with this email.

Confidentiality: This email and any attached files are intended solely for the addressee(s) and may contain confidential and privileged information. If you received this email in error, please advise us by return email or phone and disregard the contents and immediately delete it and destroy any copies

 

 

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
Register now for the 3rd National Conference on Tourism Futures, being held in Townsville, North Queensland 4-7 August - www.tq.com.au/tfconf

Reply via email to