Hello,
I have a stored procedure that will insert the next id into the table when doing insert. I want to insert 3 records into the same table and put this insert statement inside the CFTRANSACTION tag, will the database know to grab the next id 3 times, or will it insert the same next id into the table, which would cause a key violation error.
Example:
<CFTRANSACTION>
<CFLOOP nIndx="record" FROM="1" TO="3">
<CFQUERY NAMe="insertaffil" DATASOURCE ="#DSNAME#">
INSERT into nsr_affil
(affil_id,area_id, site_id, affil_typ, created)
VALUES
(#record# ,
#attributes.area_id#, #attributes.site_id#,
'AS',{^#DateFormat(Now(),"yyyy/mm/dd"#})
</CFQUERY>
</CFLOOP>
</CFTRANSACTION>
Thanks,
Longhorn
I have a stored procedure that will insert the next id into the table when doing insert. I want to insert 3 records into the same table and put this insert statement inside the CFTRANSACTION tag, will the database know to grab the next id 3 times, or will it insert the same next id into the table, which would cause a key violation error.
Example:
<CFTRANSACTION>
<CFLOOP nIndx="record" FROM="1" TO="3">
<CFQUERY NAMe="insertaffil" DATASOURCE ="#DSNAME#">
INSERT into nsr_affil
(affil_id,area_id, site_id, affil_typ, created)
VALUES
(#record# ,
#attributes.area_id#, #attributes.site_id#,
'AS',{^#DateFormat(Now(),"yyyy/mm/dd"#})
</CFQUERY>
</CFLOOP>
</CFTRANSACTION>
Thanks,
Longhorn