Coldfusion interview Questions with answers Part 4

Add comments
SocialTwist Tell-a-Friend

69. What is CFScheduler?
It provides a programmatic interface to the ColdFusion scheduling engine. It can run a CFML page at scheduled intervals, with the option to write the page output to a static HTML page. This feature enables you to schedule pages that publish data, such as reports, without waiting while a database transaction is performed to populate the page.

77. What is CFTransaction?
For enterprise database management systems that support transaction processing, instructs the database management system to treat multiple database operations as a single transaction. It provides database commit and rollback processing. See the documentation for your database management system to determine whether it supports SQL transaction processing.
Syntax

<cftransaction 
action = "begin|commit|rollback|setsavepoint"
isolation = "read_uncommitted|read_committed|repeatable_read"
savepoint = "savepoint name">
</cftransaction>

78. Can we have more than Data Source within CFTransaction?
No.Datasource Names For All The Database Tags Within CFTRANSACTION Must Be The Same.
The workaround for the problem of CFTRANSACTION with different data source,
   Use same datasource in CFQUERY
   but inside the cfquery prefix the table with desired database in the query.
    <CFTRANSACTION>
      <cfquery datasource=same>
         SELECT * FROM TableName
      </cfquery>
      <cfquery datasource=same>
        SELECT * FROM other.dbo.TableName
      </cfquery>
    </CFTRANSACTION>

79. What are the different attributes in CFQuery?

Attribute

Description

name

Name of query. Used in page to reference query record set. Must begin with a letter. Can include letters, numbers, and underscores.

blockFactor

Maximum rows to get at a time from server. Range: 1 - 100. Might not be supported by some database systems.

cachedAfter

Date value (for example, April 16, 1999, 4-16-99). If date of original query is after this date, ColdFusion uses cached query data. To use cached data, current query must use same SQL statement, data source, query name, user name, password.
A date/time object is in the range 100 AD-9999 AD.
When specifying a date value as a string, you must enclose it in quotation marks.

cachedWithin

Timespan, using the CreateTimeSpan function. If original query date falls within the time span, cached query data is used. CreateTimeSpan defines a period from the present, back. Takes effect only if query caching is enabled in the Administrator.
To use cached data, the current query must use the same SQL statement, data source, query name, user name, and password.

dataSource

Name of data source from which query gets data. You must specify either dbtype or dataSource.

dbtype

Results of a query as input. You must specify either dbtype or dataSource.

debug

  • yes, or if omitted: if debugging is enabled, but the Administrator Database Activity option is not enabled, displays SQL submitted to the data source and number of records returned by query.
  • no: if the Administrator Database Activity option is enabled, suppresses display.

maxRows

Maximum number of rows to return in record set.

password

Overrides the password in the data source setup.

result

Name for the structure in which cfquery returns the result variables. For more information, see Usage.

timeout

Maximum number of seconds that each action of a query is permitted to execute before returning an error. The cumulative time may exceed this value.
For JDBC statements, ColdFusion sets this attribute. For other drivers, see the driver documentation.

username

Overrides user name in the data source setup.

 

80. What is Query in Query?

ColdFusion allows developers to reuse existing queries by running queries against them in memory. This gives you the advantage of being able to avoid the often costly performance hit of going back to the database to manipulate data that the application server has already recently called. A standard <cfquery> statement can be used to call a query variable in memory as though it were simply a table of data in an available data source. Query variables can even be joined, which provides interesting possibilities for joining data from disparate information sources.

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

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