On Tue, Oct 26, 2010 at 1:40 PM, Matt Quackenbush <[email protected]>wrote:


You sure it's finding a value to insert from other table?  And this query
variable name is unique?

other then that, I always use output inserted.fieldNames as it's one
statement instead of two.


<cfquery name="tmp">
insert into foo (field,list)

OUTPUT inserted.FieldName

  select
      <cfqueryparam value="#bar#" />,
      othertable.field
  from
      othertable
  where
      othertable.otherfield = <cfqueryparam value="#blabla#" />
;
select scope_identity() as newID from foo;
</cfquery>
<cfdump var="#tmp#" />


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338555
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to