How to Execute 2 or more insert statements using CFQuery in coldfusion?

前端 未结 6 1317
予麋鹿
予麋鹿 2021-01-13 08:29

Is it possible to Execute 2 insert or Update Statements using cfquery?

If yes how?

if no, what is the best way to execute multiple queries in Co

6条回答
  •  -上瘾入骨i
    2021-01-13 09:02

    Use CFTRANSACTION to group multiple queries into a single unit.

    Any queries executed with CFQUERY and placed between and tags are treated as a single transaction. Changes to data requested by these queries are not committed to the database until all actions within the transaction block have executed successfully. If an error occurs in a query, all changes made by previous queries within the transaction block are rolled back.

    Use the ISOLATION attribute for additional control over how the database engine performs locking during the transaction.

    For more information visit http://www.adobe.com/livedocs/coldfusion/5.0/CFML_Reference/Tags103.htm

提交回复
热议问题