Logo F2FInterview

Coldfusion Interview Questions

Q   |   QA

CFparm only writes to the variable if the variable does not exist.
CFSet overwrites the variable with a new value regardless of if it exists.

Tag Version:
 <cfparam name="variableName" default="defaultValue">
Script Version:
 <cfscript>
  if(Not isDefined('variableName'))
    variableName = "defaultValue"
 </cfscript> 

It defines lifetime or scope of a cookie variable.
expires attribute is optional attribute for cfcookie tag.Default value is till the browser is closed.If you didn't mention the expires attribute for an cookie variable it will available upto browser close.

CfQuery
   * Safer for SQL injection attack
   * Can do any sql operations
Cfinsert/Cfupdate
   * Designed to do one thing and one thing only
   * Only work with FORM fields
   * FORM fields be named the same as the table columns
   * Cannot do any processing or manipulation of the values
   * When updating the row primary key must be present as a FORM field (possibly as a hidden field).
   * If you are using CFCs as a database abstraction layer then you can't use cfinsert/cfupdate

To execute a stored procedure, you can use either the <cfquery> or <cfstoredproc> tag. Each has its own advantages and disadvantages.
cfquery :
      * simple to use
      * Maximum flexibility in terms of creating dynamic sql for the query
cfstoredproc :
      * It provides support for multiple record sets returned from a stored procedure, meaning that you can create more than one record set from the same procedure.
      * Some variables, such as the status code that is created when the tag is called, are not available through cfquery. 

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: