Coldfusion interview Questions with answers Part 5

ColdFusion Add comments
SocialTwist Tell-a-Friend

85. How can you connect with database from Coldfusion?
      Database manipulation tags (cfquery, cfstoredproc, cfinsert, cfupdate) have an attribute called datasource which used to identify/connect to a database.
      Data sources can be defined in CF administrator section.

90. How can you create Tab strip?

    Coldfusion introduced easy to use AJAX UI elements. cflayout and cflayoutarea tags used to create tab strips.

<cflayout type="tab">
    <cflayoutarea title="Tab 1">
        I am normal tab content
    </cflayoutarea>
    <cflayoutarea title="Tab 2" selected="true">
        This tab selected at page load
    </cflayoutarea>
    <cflayoutarea title="Tab 3" disabled="true">
        you can't see me, bcz I am in disabled tab
    </cflayoutarea>
    <cflayoutarea title="Tab 4" closable="true">
        U can kill :) (close) me
    </cflayoutarea>
</cflayout>

91. What is Flash form?
     Flash form is a form like ordinary HTML form, with flash format which run on flash player enabled browsers.
     Using cfform tag CF automatically generates the swf format form's Flash binary from your CFML code.
     Flash Forms can be used to create a better forms experience for your users.
     These features include accordion-style and multiple-tab form panes and automatic element positioning.
     You can also display cftree, cfgrid, and cfcalendar form elements as Flash

92. How can you show the report in PDF?
CF Report builder is professional reporting tool coming with CF. CF 8.0.1 contains build in report builder.
In earlier releases, this report builder available as separate installable. You can find the downloads below URL
http://www.adobe.com/support/coldfusion/downloads_updates.html
There have been many software packages that offer these types of solutions, including Crystal Reports, Actuate
CFReport tag used to integrate the Report builder templates into HTML & Pdf reports. Format attribute of cfreport tag used to show the reports into PDF.

<cfreport template="userList.cfr" query="users" format="PDF" title="Sales Department Employees" />

93. What is SaveContent?
Used to save the generated content to a variable, including the results of evaluating expressions and executing custom tags.
This tag requires an end tag.
Main usage of savcontent is cache partial pages.

94. What is CFFlush?
The first occurrence of this tag on a page sends back the HTML headers and any other available HTML. Subsequent cfflush tags on the page send only the output that was generated after the previous flush.
When you flush data, ensure that enough information is available, as some browsers might not respond if you flush only a small amount. Similarly, set the interval attribute for a few hundred bytes or more, but not thousands of bytes.
Use the interval attribute only when a large amount of output will be sent to the client, such as in a cfloop or a cfoutput of a large query. Using this form globally (such as in the Application.cfm file) might cause unexpected errors when CFML tags that modify HTML headers are executed.
Caution: Because the cfflush tag sends data to the browser when it executes, it has several limitations, including the following: Using any of the following tags or functions on a page anywhere after the cfflush tag can cause errors or unexpected results: cfcontent, cfcookie, cfform, cfheader, cfhtmlhead, cflocation, and SetLocale. (These tags and functions normally modify the HTML header, but cannot do so after a cfflush tag, because the cfflush sends the header.) Using the cfset tag to set a cookie anywhere on a page that has a cfflush tag does not set the cookie in the browser. Using the cfflush tag within the body of several tags, including cfsavecontent, cfquery, and custom tags, cause errors. If you save Client variables as cookies, any client variables that you set after a cfflush tag are not saved in the browser.
Note: Normally, the cferror tag discards the current output buffer and replaces it with the contents of the error page. The cfflush tag discards the current buffer. As a result, the Error.GeneratedContent variable resulting from a cferror tag after a cfflush contains any contents of the output buffer that has not been flushed. This content is not sent to the client. The content of the error page displays to the client after the bytes that have been sent.

95. What is the difference between HTMLEditFormat and HTMLCodeFormat?
    Both are used to replaces special characters in a string with their HTML-escaped equivalents
    Difference between HTMLCodeFormat function and HTMLEditFormat is that HTMLEditFormat does not surround the text in an HTML pre tag

96. What is URLFormat?

Part A:
  This is simply the http path to your server and the directory.
  It contains 3 components,
     The protocol to use to retrieve the object. (Eg, Http, Https)
     DNS name or an IP address Web server
     The host machine port on which the Web server is running. If omitted, the specified protocol's default port is used; for Web servers, this port is 80.
Part B:
  This is the name of application or file to retrieve or the script to execute
Part C:
  This is the most important part of the URL also known as the query string.
  It is started by the question mark "?".
  Individual parameters, are separated by the ampersand "&".

97. What is CFAbort?
Stops the processing of a ColdFusion page at the tag location.
ColdFusion returns to the user or calling tag everything that was processed before the cfabort tag.
You can optionally specify an error message to display using showError attribute.
The tag is often used with conditional logic to stop processing a page when a condition occurs.

98. What is the difference between CFAbort and CFBreak?
Please see Answer:101

99. What is CFQueryparam? What is the use?
It separates parameters from the surrounding SQL.
It allows the database’s SQL analyzer to more efficiently handle the SQL statement
It validates data for the parameters which used to avoid SQL injection attacks.
One limitation of cfqueryparam in earlier versions.
 you can’t use the cachedwithin or cachedafter attributes of the cfquery tag when using the cfqueryparam tag.
 CF 8 will allow this

100. How can you create dynamic query?
   Dynamic SQL is a SQL code that your program generates using variables before the SQL is executed.
   In coldfusion, CFQUERY give full provision to write all conditional logic & looping to derive the dynamic sql statement to execute.

   You can use dynamic SQL to accomplish tasks such as adding WHERE clauses to a search based on the fields that the user filled out on a search criteria page.

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

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