Insert multiple rows at a time in database
We can insert multiple rows in data using one query.It reduce the number of times execute requests. I Type : <Cfquery name="InsertReportDetails" datasource="TestDB"> INSERT INTO UserReporting(UserId,BatchId, ReportId) SELECT #session.UserID#,2,1 UNION SELECT #session.UserID#,2,2 UNION SELECT #session.UserID#,2,3 UNION SELECT #session.UserID#,2,4 </Cfquery> II Type : <Cfquery name="InsertReportDetails" datasource="TestDB"> INSERT INTO UserReporting(UserId,BatchId, ReportId) VALUES (#session.UserI...
Comments
Post a Comment