Should I use CFQUERYPARAM in a cfinvokeargument value?

Need some advice. Please see code below.

Is it secure?

Should I use CFQUERYPARAM in a cfinvokeargument value? Is it possible or advisable to do so?

I am working to make my applications more secure. Thanks for any advice.

A form process page that updates web address links in a database table.

<!--- Edit or update? --->
<cfif IsDefined("FORM.LinkID")>
 <cfset method="update">
 <cfset method="add">

<!--- Proceed --->
<cfinvoke component="/client/updateLink"
 <!--- LinkID only if update method --->
  <cfif IsDefined("FORM.LinkID")>
  <cfinvokeargument name="LinkID"
 <cfinvokeargument name="Title"
 <cfinvokeargument name="WebAddress"
 <cfinvokeargument name="Description"
 <cfinvokeargument name="DateAdded"

<!--- When done go back to link list --->
<cflocation url="/admin/manageLink.cfm">

Open in new window

Eric BourlandAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I'm not sure what you mean.  You mean add cfqueryparam as part of the cfinvokeargument statement? No. You can't. cfqueryparam  is only allowed inside cfquery tags.  

If you mean use it inside the function called by cfinvoke, then yes. You should do that.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Eric BourlandAuthor Commented:
>>>cfqueryparam  is only allowed inside cfquery tags.  

I was 90% sure of this.

 <cfinvokeargument name="Title"
                   value=<cfqueryparam cfsqltype="cf_sql_varchar" value="#ARGUMENTS.Title#" maxlength="60">

... is not valid. Got it. That was my question. =)

I do use CFQUERYPARAM with all INSERT, UPDATE, and DELETE queries -- within a CFC or a plain old ColdFusion page.

Thank you as always, _agx_.

Always a pleasure :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.