Pete Freitag Pete Freitag

Save your self some typing

coldfusion

If you want to save yourself some typing, note that cf_sql_varchar is the default value for the cfsqltype attribute in the cfqueryparam tag.

So you can omit the cfsqltype attribute, if your type is cf_sql_varchar at the expense of some readability.

I probably would not mention this if cfqueryparam was not so verbose. Why not type="varchar" what's with all the cfsql/cf_sql_?


Like this? Follow me ↯

Save your self some typing was first published on April 07, 2005.

If you like reading about cfml, or cfqueryparam then you might also like:

FuseGuard Web App Firewall for ColdFusion

The FuseGuard Web Application Firewall for ColdFusion & CFML is a high performance, customizable engine that blocks various attacks against your ColdFusion applications.

Comments

Ah, great tip. You're right, cfqueryparam is horribly verbose, if nothing else this may improve readability...
by Ryan Guill on 04/07/2005 at 1:02:43 PM UTC
That's what code snippets are for, and when you bind them to a keyboard shortcut (as most editors aside from DWMX let you do), it becomes even less typing. For example, I've got a CFQP for integer, timestamp, and varchar mapped to different keys, so I can insert them with a single (compound) keystroke.
by Barney on 04/07/2005 at 1:33:10 PM UTC