Coldfusion interview Questions with answers Part 6

ColdFusion Add comments
SocialTwist Tell-a-Friend

101. What is the difference between cfabort, cfexit, cfbreak
  Cfbreak:
    * Used within a cfloop/cfswitch tag used to break out of a loop/switch block.
  Cfabort:
    * Stops the processing of a ColdFusion page at the tag location.
  Cfexit:
    * cfexit returns control to the page that called that custom tag, or in the case of a tag called by another tag, to the calling tag.
    * If cfexit is used outside a custom tag, it functions like a cfabort.

102. What is the difference between cfset, cfparam?
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.

103. How can you implement cfparam into cfscript?
Tag Version:
 <cfparam name="variableName" default="defaultValue">
Script Version:
 <cfscript>
  if(Not isDefined('variableName'))
    variableName = "defaultValue"
 </cfscript>

104. What is the use of cfcookie expires attribute? What is the default value for the same?
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.

105. What is the difference between cfquery & cfinsert/cfupdate
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

106. cfquery/cfstoredproc Which is good for stored proc call?
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.

107.What is the use of cfsetting?
This tag used to Control the requested URL's page processing, such as the output of HTML code in pages.It has 3 attributes.
  * enableCFoutputOnly
  * requestTimeOut
  * showDebugOutput
All are optional attributes. you should mention atleast one attribute.Here I will explain a bit about requestTimeOut attribute.Rest two explained for the next question.
     This attribute added in ColdFusion MX varsion.
     It used to define time limit, after which ColdFusion processes the page as an unresponsive thread.
    Overrides the time-out set in the ColdFusion Administrator.

108. Explain about enableCFoutputOnly, showDebugOutput attributes of cfsetting tag
enableCFoutputOnly    
    * yes: blocks output of HTML that is outside cfoutput tags.
    * no: displays HTML that is outside cfoutput tags.
showDebugOutput
    * yes: if debugging is enabled in the Administrator, displays debugging information.
    * no: suppresses debugging information that would otherwise display at the end of the generated page.

0 responses to “Coldfusion interview Questions with answers Part 6”

Leave a Reply

*** Please do not post spam. All comments require moderation,
So it may take some time to post to this blog! ***





Powered by Mango Blog. Design and Icons by N.Design Studio