I have a SQL update. When it tries to update data a row that doesn't exist I don't get
an error, I don't get 0 rows, I get the query variable itself doesn't exist!?
See sample code:
<!---------------------------------------------------------------------------------------------->
Testing SELECT on non-existent data <br>
<cfquery name="sel" datasource="dsn">
select UserName from Users where UserName = "nevernevernotever"
</cfquery>
Select done on <cfoutput>#sel.RecordCount#</cfoutput> records. <br>
<p>
Testing UPDATE on non-existent data <br>
<cfquery name="upd" datasource="dsn">
update Users set UserName = "xyzzy" where UserName = "nevernevernotever"
</cfquery>
Update done on <cfoutput>#upd.RecordCount#</cfoutput> records.<br>
<!---------------------------------------------------------------------------------------------->
Here is the output:
Testing SELECT on non-existent data
Select done on 0 records.
Testing UPDATE on non-existent data
Update done on
Error Occurred While Processing Request
An error occurred while evaluating the expression:
#upd.RecordCount#
Error near line 13, column 27
Error resolving parameter UPD.RECORDCOUNT
And strangely enough my debugging output tells me the query DOES exist:
Queries
sel (Records=0, Time=131ms)
SQL =
select UserName from Users where UserName = "nevernevernotever"
upd (Records=0, Time=15ms)
SQL =
update Users set UserName = "xyzzy" where UserName = "nevernevernotever"
I also tried putting a <cftry> around it, but no error is being thrown
---------------------------------------------------------------------------
Peter Theobald, Chief Technology Officer
LiquidStreaming http://www.liquidstreaming.com
[EMAIL PROTECTED]
Phone 1.212.545.1232 x204 Fax 1.212.545.0938
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.