Logo F2FInterview

Coldfusion Interview Questions

Q   |   QA

Coldfusion has a beautiful feature called Query of Queries which is mainly used for improving performance of the application.
Query of Queries is the result of an existing database query result.
This will be done by using coldfusion “cfquery” tag and need to specify dbtype = ‘query’.
Eg:
<cfquery dbtype="query">
select *
from NameOfAnotherQuery
where ColumnName = 'SomeValue'
</cfquery>

Coldfusion provides us many debugging options in order to trouble shoot a coldfusion program.
The important are:
CFDUMP,  eg: <cfdump var="#abcd#">
 
CFABORT, eg:  <cfabort>
On the debugging settings in coldfusion administrator. (you will see the lengthy debugging information at the bottom of the coldfusion result).

By using coldfusion <cfftp> tag, we can send data from local computer to the server and also retrieve the data from server to the local computer.
By using Get file, we can retrieve data from server:
<cfftp
        action="getFile"
        server="127.0.0.1"
        username="user1"
        password="pass1"
        remotefile="/abcd.jpeg"
        localfile="C:examples/efgh.jpg"
failIfExists="no">

 
By usingPut file, we can send data to the server:
<cfftp
        action="putFile"
        server="127.0.0.1"
        username="user1"
        password="pass1"
        localfile="C:examples/efgh.jpg"
        remotefile="/abcd.jpeg"
failIfExists="no">

While debugging is mainly used to debug the code and to see run time values. Especially for trouble shooting. How ever, once the programs are in production server, we can not debug, but to avoide users seeing all the error messages when a program unexpectedly failed and throwing errors, we can use error handling methods.
TRY and CATCH is the best among them to handle any database related errors.
<cftry>
Here is your actual code…of coldfusion….
<cfcatch>
Write your message  to the user in case of any error.
</cfcatch>
</cftry>
 
i.e basically we are packaging our code using cftry and cfcatch tags.

<cfcomponent>
     <cffunction>
         <cfargument/>
        <cfargument/>
        <cfargument/>
        </cffunction>
</cfcomponent> 

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: