I have a function similar to the one below. I want to perform the update in the first query and then insert some data into a different table in the 2nd query using the record numbers (ID)s that were updated in the first query. Could someone assist? The first query is fine... the 2nd doesn't work obviously. The ID is the primary key for the records in the first query.
<cffunction name="myFunction" output="false" access="remote" returntype="string" hint="">
<cfargument required="true" type="string" name="Name" />
<cfargument required="true" type="string" name="Age" />
set Status = 'Complete', Notes = 'blah'
where Age = <cfqueryparam value = "#Trim(ARGUMENTS.Age)#" CFSQLType = "CF_SQL_VARCHAR">
--------this is where i want to insert a record for each of the ones that were updated above....
INSERT INTO myDB.Table2 (ID, age, blah)
I know this isn't a complete query/example but I am hoping I gave enough information. Thank you.