I have created a small CFC that is designed to accept any SQL query and execute against a data source. It works when the query is hardcoded, but I can't seem to pass the variable correctly:
CFC:
<cfcomponent>
<cffunction name="sendSQL" access="remote" output="true" returntype="query">
<cfargument name="sqlvar" type="string" required="True" default="">
<cfquery name="SQLQuery" datasource="flamingo" >
#arguments.sqlvar#
</cfquery>
<cfreturn SQLQuery>
</cffunction>
</cfcomponent>
INVOKED BY:
<cfinvoke
webservice=" method="sendSQL"
returnvariable="query" sqlvar="#sqlquery#" >
</cfinvoke>
ERROR is:
Web service operation "sendSQL" with parameters {SQLVAR={select contactname from invoice},} could not be found.
Any ideas would be gratefully received
CFC:
<cfcomponent>
<cffunction name="sendSQL" access="remote" output="true" returntype="query">
<cfargument name="sqlvar" type="string" required="True" default="">
<cfquery name="SQLQuery" datasource="flamingo" >
#arguments.sqlvar#
</cfquery>
<cfreturn SQLQuery>
</cffunction>
</cfcomponent>
INVOKED BY:
<cfinvoke
webservice=" method="sendSQL"
returnvariable="query" sqlvar="#sqlquery#" >
</cfinvoke>
ERROR is:
Web service operation "sendSQL" with parameters {SQLVAR={select contactname from invoice},} could not be found.
Any ideas would be gratefully received