I've been using the SQL NOCOUNT and Select @@identity to retrieve the ID of 
newly inserted rows. I recently (after the talk on this list yesterday -re: 
sql injection attacks) decided to update these inserts to use 
<cfqueryparam>. But it appears as though <cfqueryparam> does not support 
the use of the NOCOUNT declaration. I get an error that reads:

" Could not find prepared statement with handle -1. "

Does this mean it is not possible to use the NOCOUNT feature to return the 
newly inserted ID?

Also, is performance improved on an Insert operation? Is it worth 
considering adding another query to retrieve the recordID separately so 
that <cfqueryparam> can be used? Would this be a major performance hit? The 
insert operation is used extensively and could be the target of a hack 
attempt, which is why I tried to use the <cfqueryparam> format. I'm not 
sure now if I should go back to the regular insert where I can retrieve the 
ID and do the insert all in one query, or implement the query using 
<cfqueryparam>' and a second query to get the ID. Any suggestions are 
appreciated, thanks :)

Brook









______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to