OK . I am trying to insert multiple records into the DB base on the IdentityId 
found in the insert 
But it does nor seems to be working . It only insert 1 record

<cfparam name="form.foundOn" default="">
<cfparam name="form.topLevel" default="">
<cfparam name="form.txtAreaDesc" default="">
<cfparam name="form.link" default="">
 
<cfif isDefined("form.btnAdd")>
<cftransaction> 
        <cfquery name="addTopMenu"  datasource="cfelsunrise" dbtype="ODBC">
     SET NOCOUNT ON
        insert into dbo.Menu values (<cfqueryparam cfsqltype="cf_sql_varchar" 
value="#form.topLevel#">,<cfqueryparam cfsqltype="cf_sql_varchar" 
value="#form.txtAreaDesc#">,<cfqueryparam cfsqltype="cf_sql_varchar" 
value="#form.link#">)
    SELECT @@Identity AS newId      
      SET NOCOUNT OFF   
 
    </cfquery>
    <cfquery name="addTopMenu3"  datasource="cfelsunrise" dbtype="ODBC">
  SELECT max(menuId) as menuID from menu
    
 
 
</cfquery>
<cfset lid=#addTopMenu3.menuId#>
 
    
    <!---       declare @sort2 int;
                select  @sort2= isnull(max(Order),0) from menuFoundOn where 
menuId=#addTopMenu.newId#--->
        
    <CFLOOP INDEX="ListElement" LIST="#Form.foundOn#">
    <CFQUERY Name="#ListElement#" DataSource="cfelsunrise" dbtype="ODBC">
   insert into menuFoundOn (menuId,foundOn) values (#lid#, #ListElement#)
</CFQUERY>
</CFLOOP>
 
</cftransaction>
</cfif>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299607
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to