yes. you can use any number of queries in a single function.
you can also call other functions from same or other
components.
so if you already have another function in this or other
component that
returns the image filename based on theme id you can just
call that
function instead of writing another query:
<cffunction name="getImageFilename" ...>
<cfargument name="themeID" ...>
<cfset var qFilename = "">
<cfquery name="qFilename" ...>
SELECT imagefilenamecolumn
FROM ...
WHERE themeid = ...
</cfquery>
<cfreturn qFilename.imagefilenamecolumn>
</cffunction>
<cffunction name="deleteTheme" ...>
<cfargument name="themeID" ...>
<cfset var imagefile =
getImageFilename(arguments.themeID)>
<cfset var qDelete = "">
<cfset var imagepath = "...">
<cfif fileexists(imagepath & imagefile)>
<cffile action="delete" ...>
</cfif>
<cfquery name="qDelete" ...>
DELETE FROM themes WHERE ...
</cfquery>
</cffunction>
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/