Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checking insert query worked

Status
Not open for further replies.

zma

Programmer
May 30, 2006
25
US
Is there a ColdFusion feature that shows whether or not an INSERT query worked?
Right now I'm using SELECT queries after the INSERTs to make sure records got appended-I look up what just got added to make sure it's there. Is there a better way?
Thank you very much.

 
i have to ask, why would the record not be there? to me, if the query did not throw an error - the record should be there. i guess i need to understand the scenario in which you would need to do this.

=========================================
Don't sweat the petty things and don't pet the sweaty things.
 
no error, no problem.

if you need your last ID, then selecting what you inserted (if the combination is unique) is a good way that is thread safe.

Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
And perhaps what was discussed in thread232-1262979 would ensure you.
 
you could alwsy check the debug settings if you switch them on, as each sql statement completes it will show the results at the bottom of the page along side your avraiables etc.
thsiswould be the best way to code I would suggest, add your IP to an allow list so no one else sees the debug. all don through the control panel in CF admin.

hope this helps

If you can Server it virtualise!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top