Question
Data created by query doesn't exist
Hello struggling with inherited code here.
CFSET below is not be working since moving to CF8.
CF returns "Element ITEM_ID is undefined in INSERTITEM"
How can I get the ID generated in the "insertItem" Query and pass it to
the the "itemOptions" query?
The code below works IF I manually place a UUID in the CFSET tag for
"insertItem.item_id".
Thanks for any help!
<cfif NOT len(form.item_id)>
<cfquery name="insertItem">
INSERT INTO table(item_id)
VALUES( <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#createUUID()#">)
</cfquery>
<cfset form.item_id = insertItem.item_id>
</cfif>
<cfquery name="itemOptions">
INSERT INTO items_xref_tb(itemOption_id,item_id)
VALUES(<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#form.item_id#">)
</cfquery>
CFSET below is not be working since moving to CF8.
CF returns "Element ITEM_ID is undefined in INSERTITEM"
How can I get the ID generated in the "insertItem" Query and pass it to
the the "itemOptions" query?
The code below works IF I manually place a UUID in the CFSET tag for
"insertItem.item_id".
Thanks for any help!
<cfif NOT len(form.item_id)>
<cfquery name="insertItem">
INSERT INTO table(item_id)
VALUES( <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#createUUID()#">)
</cfquery>
<cfset form.item_id = insertItem.item_id>
</cfif>
<cfquery name="itemOptions">
INSERT INTO items_xref_tb(itemOption_id,item_id)
VALUES(<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#form.item_id#">)
</cfquery>
