Loading...

Follow Adobe ColdFusion | Connect with community on Feedspot

Continue with Google
Continue with Facebook
or

Valid

Finding detailed information in a large database can sometimes be a daunting task.

Fortunately, with ColdFusion, you make your searches and data pull a breeze with Query of Queries! Utilizing this awesome function is sure to make any CIO or Project Leader’s job easier.

In this article, you will learn:

  1. What is a Query of Queries?
  2. What are the benefits of using a Query of Queries?
  3. How to conduct a Query of Queries.
  4. What are some functionalities of ColdFusion Query of Queries?

Let’s dive right in!

What is a Query of Queries?

A Query of Queries is a unique feature in its own respect because you can’t have one without… well, queries. You see, after you have created a recordset with a tag or function (such as cfquery ), data can be recalled. It may be recalled individually or as part of a dependent query. That recall is known as a Query of Queries. Any query that retrieves data from a recordset is a Query of Queries. It can also be known as a Memory Query because recordsets can be formed in other ways than the cfquery tag.

ColdFusion QoQ can used for other queries as well. For example, you can actually query a non-query database object as well. It’s a super handy feature that has many benefits.

ColdFusion Query of Queries Benefits

Let’s take a look at a few of the benefits of ColdFusion QoQ. 1. Convenient Table Recall

There are times when you need recall the same tables over and over again. And the bigger the table- the more frustrating it can get. But ColdFusion QoQ makes things easier because the data is already in the recordset. QoQ is perfect for tables between 5000 and 50000 rows. Its only limitation is the memory of the ColdFusion host computer.

Using QoQ allows you to perform join and union operations on results from completely different databases. This can definitely come in handy. For instance, you can use a union operation on queries from separate databases in order to eliminate duplicates from an email list of clients.

This is particularly useful for CIOs and Team Leaders. After performing a query on a database just once, your results can be used to generate many different tables. This comes in handy for creating summary tables for employee salaries, infographics, or availabilities. Just make a single query to your employee database and use the results given to generate three separate tables from just one pull.

Wouldn’t it be nice to have drill-down details on things without having to access a database? You can by using QoQ. For instance, you can pull a query on employee information using QoQ and then cache it. Afterwards, create a table or drop-down list of employee names.

This way when users select a particular employee name, your application accesses the cached data vice needing to call the database.

Subreports are an awesome way to nest a report inside your other reports. This can become a very convenient way to post secondary information within your primary presentation. Subreports are great if you wish to avoid using complex SQL or if your report requires data from multiple data sources. QoQ helps you to generate these subreports and streamline your reports.

How to Successfully Conduct a ColdFusion Query of Queries

When it comes to conducting a ColdFusion QoQ, it’s a pretty simple process. Just follow these four easy steps:

  1. Create a recordset through a master query. Master queries may be generated through tags or functions that create recordsets.
  2. Compose a detail query. This would be a cfquery tag that specifies dbtype= “query”
  3. Write an SQL statement that retrieves the applicable information. A datasource does not need to be specified at this point. However, specify the names of one or more currently existing queries as table names within your SQL code.
  4. Your database content should be changing rapidly. But if it doesn’t, manipulate the cachedwithin attribute of your master query to cache queries between page requests. Use the CreateTimeSpan function (in days, hours, minutes, seconds format) to specify the value. Doing so allows for your ColdFusion to access the database on the first request. The database will only be queried again after the set time has expired.

Adobe provides an excellent example for creating and using these results.

<h1>Employee List</h1>

<cfquery datasource=”cfdocexamples” name=”master”

cachedwithin=#CreateTimeSpan(0,1,0,0)#>

SELECT * from Employee

SELECT Emp_ID, FirstName, LastName

FROM master

WHERE LastName=<cfqueryparam value=”#LastNameSearch#”

cfsqltype=”cf_sql_char” maxLength=”20″></cfquery>

<p>Output using a query of query:</p>

#Emp_ID#: #FirstName# #LastName#<br>

<p>Columns in the master query:</p>

#master.columnlist#<br>

<p>Columns in the detail query:</p>

#detail.columnlist#<br>

Querying a Non-Database Query Object

One of the best things about QoQ is that you can query a non-database query object. An example of this is retrieving the results of a <cfftp> directory listing.

Functionalities of ColdFusion Query of Queries

ColdFusion QoQ has many functionalities and their relation to QoQ is as follows:

ACF and Lucee QoQ are very similar, but there are several differences due to the SQL engines used in each CFML engine. These differences present themselves more so in difficult SQL statements-such as grouping functions. A simple rewrite of the SQL code should absolve most complications with Lucee QoQ.

ColdFusion’s Query of Queries is a wonderful tool that makes your CF lives a whole heck of a lot more convenient. It streamlines your processes and creates elegant output that you and your company can easily use.

When have you found query of queries to be most helpful? What practical applications do you use it for?

Let us know in the comments below. And… If what you like what you read, you can always follow us on Twitter @CFTeraTech and make sure you don’t miss an update.

And to continue learning how to make your ColdFusion apps more modern and alive, I encourage you to download our free ColdFusion Alive Best Practices Checklist.

Because… perhaps you are responsible for a mission-critical or revenue-generating CF application that you don’t trust 100%, where implementing new features is a painful ad-hoc process with slow turnaround even for simple requests.

What if you have no contingency plan for a sudden developer departure or a server outage? Perhaps every time a new freelancer works on your site, something breaks. Or your application availability, security, and reliability are poor.

And if you are depending on ColdFusion for your job, then you can’t afford to let your CF development methods die on the vine.

You’re making a high-stakes bet that everything is going to be OK using the same old app creation ways in that one language — forever.

All it would take is for your fellow CF developer to quit or for your CIO to decide to leave the (falsely) perceived sinking ship of CFML and you could lose everything-your project, your hard-won CF skills, and possibly even your job.

Luckily, there are a number of simple, logical steps you can take now to protect yourself from these obvious risks.

No Brainer ColdFusion Best Practices to Ensure You Thrive No Matter What Happens Next

ColdFusion Alive Best Practices Checklist

Modern ColdFusion development best practices that reduce stress, inefficiency, project lifecycle costs while simultaneously increasing project velocity and innovation.

Easily create a consistent server architecture across development, testing, and production

modern test environment to prevent bugs from spreading

√ Automated continuous integration tools that work well with CF

portable development environment baked into your codebase… for free!

Learn about these and many more strategies in our free ColdFusion Alive Best Practices Checklist.

Originally published at https://teratech.com on June 19, 2019.

The post ColdFusion Query of Queries (Streamline your Processes) appeared first on ColdFusion.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

I am attempting to create a new project in ColdFusion Builder 2018.  It is giving me the error, “Invalid project description.”

I have done the following steps:

(1) Choose /File | New | ColdFusion Project

(2) Chose BLANK under System Templates

(3) Set Type to NONE 

(4) Clicked Next

(5) Set Project Name: Learn_CF_In_a_week

(6) Unchecked Use Default Location

(7) Set Project Location to C:ColdFusionBuilder2018ColdFusioncfusionwwwrootlearncfinaweekwww

(8) Set CFML Dictionary Version to ColdFusion 2018

(9) Clicked Next

(10) Set Servers to defaultLocal

(11) Clicked Next

(12) Left the Addional Source blank

(13) Clicked Next

What am I doing wrong?  Where would I enter this ‘project description’?

Thank you in advance,

Mark

The post “Invalid project description” when creating a new project in ColdFusion Builder 2018 appeared first on ColdFusion.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

I’m writing this to those who may report in passing (to me or on the forums or portal here) that they “have x updates of CF to do” for their machine, because they skipped some in the past. Or while helping them on their machines (in my consulting), I may see that their hf-updates folder shows multiple updates done the same day, one after another.

In both cases, they are mistakenly assuming that they need to apply each update, one at a time, when they see many. You do NOT.

You need only ever apply the latest update (assuming it’s what you want), if you have more than one available. They are cumulative. You will get the benefits of all the skipped updates by applying the latest.

That said, it’s still in your interest to review the technotes of the updates you’re skipping, to see important information that about those others you’re skipping. Before applying them, you can see the “read more” link offered in each update shown in the CF Admin “Server Updates” user interface for “available updates” (after applying updates, you will only see in “installed updated” only the one(s) you explicitly installed–not those you applied implicitly doing this.)

You can also find the technote for any previous CF update by just googling/searching it by name, such as “ColdFusion 2018 update 2”.

The post Note: you only need to apply the latest of many CF updates appeared first on ColdFusion.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Welcome to Adobe® ColdFusion® Builder 2018

Version: 3.2.1
Build: 313943

© 2010 – 2018 Adobe. All Rights Reserved.

Eclipse and ‘Built on Eclipse’ are trademarks of Eclipse Foundation, Inc.

This Product includes code licensed from RSA Data Security

Notices, Terms and Conditions pertaining to third party software are located at
http://www.adobe.com/go/thirdparty/ and incorporated by reference herein.

Build date: 04 February 2019, 02:53:05

Coldfusion Server 2018

Server Details
Server Product ColdFusion
Version 2018,0,04,314546
Edition Developer
Operating System Windows 10
OS Version 10.0
Update Level /C:/ColdFusion2018/cfusion/lib/updates/chf20180004.jar
Adobe Driver Version 5.1.4 (Build 0001)
Tomcat Version 9.0.10.0

The post Administration of CF Server from within CFB 2018 not working. appeared first on ColdFusion.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Anyone know why my Server Updates page has quit showing the installer or updates pane? I was able to apply previous updates to 2016 so not sure why it’s just decided to quit working.

The post CF2016 Administrator Server Update will not show installer or updates appeared first on ColdFusion.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Adobe ColdFusion (2018 release) has the Performance Monitoring Toolset that aids in monitoring and management of performance and availability of software applications. Performance Monitoring Toolset strives to detect and diagnose complex application performance problems to maintain an expected level of service.

Performance Monitoring Toolset in Adobe ColdFusion is built with touch points for each role involved in contributing to the overall health of the architecture, high performance and scalability. The Performance Monitoring Toolset lets you view and monitor from remote servers and drill down metrics to get to the bottom of the issues quickly.

Join this three part webinar series which would walk through from getting started to the advanced functions in the Performance Monitoring Toolset. Register Now at https://cfwebinars.meetus.adobeevents.com/

Webinar 1 :  An overview of the nifty new Performance Monitoring Toolset

                     Elishia Dvorak | July 10, 2019 at 1pm PT

Get a good understanding of all the capabilities of this toolset to improve the performance and stability of your applications. Learn the end-to-end performance management right from the connector, application, individual lines of code, database, incoming/outgoing services, system metrics, memory management to JVM metrics

Webinar 2 :  Troubleshooting your application using Performance Monitoring Toolset

                       Rakshith Naresh | July 17, 2019 at 11am PT

This session walks you through various scenarios that you may encounter while working with your ColdFusion application. These scenarios will help you with most common problems that you encounter while dealing with your ColdFusion application. This session will cover,
  1. Issues around JVM – Gain insight on the various JVM metrics, memory management and garbage collection.
  2. Database issues – Get a good sense of how to deal with database related issues in your application
  3. Application specific issues – Issues around application setting and application specific settings. You will also understand how to leverage the built-in code profiler in the toolset
  4. System architecture – Understand how PMT can help you resolve issues around system/application architecture. Also understand the hassle free auto connector tuning capability

Webinar 3 : A Deep dive into troubleshooting by leveraging the advanced capabilities of Performance Monitoring Toolset

                     Rakshith Naresh | July 24, 2019 at 11am PT

In this session we will focus on the advanced capabilities of Performance Monitoring Toolset that will leave with you with an understanding that Performance Monitoring Toolset is the only tool you need for anything related to monitoring and measuring your ColdFusion application. You will gain insight on resolving performance issues by leveraging thread dumps, code profiling, memory profiling and connector tuning. You will also understand how you can effectively architect your Performance Monitoring Toolset to make the best use of the tool for your ColdFusion usage.
Register Now to understand the feature set in Performance Monitoring Toolset.

The post Performance Monitoring Toolset Webinar Series appeared first on ColdFusion.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Adobe ColdFusion Summit 2019 Early Bird rates have been extended till June 30th. Register Now at the early bird rate of $99 for the 2 day conference and $399 for the Adobe ColdFusion Certificate Program. The certificate program has only a few seats left.

The full day conference rate gives you access to more than 40 sessions and the evening party on day one. Breakfast and Lunch on both days are also included.

We have also announced our first list of 20 sessions that would be given by our great community champions. Please review them at https://cfsummit.adobeevents.com/speakers/.

For further details please visit the website at https://cfsummit.adobeevents.com/

The post Adobe ColdFusion Summit 2019 – Early Bird price extended till June 30 appeared first on ColdFusion.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

We are pleased to announce that we have released the updates for the following ColdFusion versions:

The following are links to the tech notes for each update:

The releases address security vulnerabilities, which are documented in the bulletin APSB19-27.

We have made the following updates in these releases:

  • Updates to LiveCycle Data Services. (For ColdFusion 2018 Update 4, ColdFusion 2016 Update 11, and ColdFusion 11 Update 19)
  • Updates to JNBridge. (For ColdFusion 2018 Update 4 and ColdFusion 2016 Update 11)
  • Added support for the following platforms in ColdFusion 2018 Update 4:
    • IBM PowerPC based RHEL 7.6 and SuSE 15
    • Mac OS X 10.14
  • Added support for the function FileAppend. (For ColdFusion 2018 Update 4 and ColdFusion 2016 Update 11)

For a list of the bugs fixed in these updates, see the following:

The post ColdFusion (2018 release) Update 4, ColdFusion (2016 release) Update 11, and ColdFusion 11 Update 19 released appeared first on ColdFusion.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Have you ever found that calls to web services from CF suddenly fail? when nothing has changed on your end? (No change of your CF version, no change of CF admin settings, nor any change regarding SSL/TLS on the host–all of which can cause their own problems.)

What may have happened is that the owner of the web service may have changed something about their definition of that web service (in terms of methods or properties or return types). And as such, you need to REFRESH CF’s caching of that web service definition.

This blog post explains the why’s and hows.

How CF caches the web service definition as Java “stubs”

Though many may not realize it, CF caches the call to the web service to obtain its WSDL (web services definition language), and CF then converts that into some java code (called “stubs”), which represent the web service definition in terms of those available methods, properties, return types, and so on.

And this conversion to Java stubs is saved in CF the first time a CFML call is made to that web service (saving them in the cfusion/stubs folder–or the stubs under some other CF instance’s folder, when you have multiple instances). Note that CF creates a separate folder for each called web service (each web service wsdl url, not for each method, nor for different calls to the same wsdl url).

And those stubs are reused on any subsequent calls from CFML to that web service.

When and how you may need to refresh that web service definition that CF has cached

Normally, such WSDL (for the web service you call) does not change, and this caching is a performance benefit. But when it does, then you may find you get an error because CF’s cached stubs don’t match the web service definition.

In that case, it’s up to you (on the CF side) to refresh that wsdl and re-generate those stubs. There are a few ways to do it.

(Technically, you COULD delete that folder (for the web service that has changed) within the stubs folder, but that’s not the most elegant way. You could delete the wrong one, or you may find that CF is trying to access the files while you re trying to delete the folder.)

Instead, CF offers a few ways to “refresh that wsdl”, two of which are most common.

Refreshing it in the CF Admin, if it’s listed there

CF used to keep a list in the CF Admin of all called web services, but somewhere along the line (CF10?), that changed and now it only lists web services in the Admin if you specifically define them there (one reason would be to give the web service an “alias” to refer to when invoking it, rather than the full wsdl url). Anyway, if you DO have a web service defined there, you can “refresh” it there.

Go to the CF Admin “Data & Services” menu option on the left (the section where Datasources are), and then choose “Web Services”, and then at the bottom of that page, see “Active ColdFusion Web Services”.

If the one you want is there, note there are buttons to the left, and one is a “refresh”, which will regenerate its web service stubs. Try your failing code and see if that solved your problem.

But if the one in question is NOT listed there, then the next simplest solution is to do the refresh in code, on the invocation of the web service itself.

Refreshing it via CFML code

Back in CF8, a new a refreshwsdl attribute was added for cfinvoke or cfobject, which if you set to true and then call the web service (as normal) will “refresh” it (and regenerate teh stubs for that web service). (There is also a way to do it on a createobject. See below.)

If your call now “works”, you’re done. (And you can go view the stubs folder to see that the folder for the service in question was updated)

Note that you do NOT want to LEAVE that refreshwsdl on the cfinvoke, though, as that would then refresh it on EVERY call. That would be bad for performance. So just remove or comment out that refreshwsdl to remind you should you ever need to do it again.

I have more on this topic (including if you use createobject, as well as using the AdminAPI or old “serviefactory” to refresh wsdl). The posts which follow, while old, still apply:

Hope that helps.

For more blog content from Charlie Arehart, see his posts here as well as his posts at carehart.org. And follow him on Twitter and other social media as carehart.

The post When you may need to refreshwsdl for calls to web services appeared first on ColdFusion.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

There are many posts already out there about Regular Expressions, but I’ve done a few blog posts which use regular expressions and thought it wouldn’t hurt to do yet another post on regular expressions for CF developers who haven’t yet tried them.

Let’s start off with which functions we have available to use in CFML:

– ReFind
– ReFindNoCase
– ReReplace
– ReReplaceNoCase
– ReMatch
– ReMatchNoCase

Essentially, there is find, replace and match functions with and without case sensitivity. For this post I’m going to be using ReReplace.

Let’s start off with a simple replace. Given the input string of Example 1 I want to replace the 1 with an !. This can be done using a straight forward replace function.

function figure1(s) {
    // replace '1' with '!'
    return s.replace("1", "!");
}

result = figure1("Example 1");
writeoutput(result); // Example !

This works great, but it’ll only work with Example 1. If we had Example 2 we’d have to write another replace statement. This is where regular expressions come in handy.

With a regular expression you can choose to match based on a pattern. For example I could match the 1 or 2 by using a bracket expression as shown below.

function figure2(s) {
    // replace '1' or '2' with '!'
    return s.rereplace("[12]", "!");
}

result = figure2("Example 1");
writeoutput(result); // Example !
result = figure2("Example 2");
writeoutput(result); // Example !

In the above figure2 I’ve switched to using a reReplace so that we can use a regular expression. The first parameter of [12] is a bracket expression. This particular pattern is defined by using the special characters [ and ] to specify a set. The expression will match any of the characters contained within the square brackets. In this example we have 12 inside the square brackets so it’ll match either 1 or 2.

This is great, but what if we have strings ending in 1,2,3,4,5,6,7,8 and 9? We could simply add all those characters to the bracket expression.

function figure3(s) {
    // replace any character in the bracket expression with '!'
    return s.rereplace("[123456789]", "!");
}

result = figure3("Example 1");
writeoutput(result); // Example !
result = figure3("Example 2");
writeoutput(result); // Example !
result = figure3("Example 5");
writeoutput(result); // Example !
result = figure3("Example 9");
writeoutput(result); // Example !

That does the job, but we can actually define a range of characters instead of having to explicitly type each one.

function figure4(s) {
    // replace any character from 1-9 with '!'
    return s.rereplace("[1-9]", "!");
}

result = figure4("Example 1");
writeoutput(result); // Example !
result = figure4("Example 2");
writeoutput(result); // Example !
result = figure4("Example 5");
writeoutput(result); // Example !
result = figure4("Example 9");
writeoutput(result); // Example !

As shown in figure4, instead of writing out each character we want to replace as [123456789] I’ve switched to using a range [1-9] which does exactly the same thing. It’s less typing and more readable.

So far so good, but we’re soon going to get to Example 10 so we need to include 0 in the bracket expression range.

function figure5(s) {
    // replace any character from 0-9 with '!'
    return s.rereplace("[0-9]", "!");
}

result = figure5("Example 1");
writeoutput(result); // Example !
result = figure5("Example 10");
writeoutput(result); // Example !0

We have a problem. The input string of Example 10 results in Example !0. What we want is for it to replace the 10 with a ! without breaking our 1 to 9 versions. In other words, we want to replace one or more numeric values with a !. To solve this we can leverage another special character in regular expressions: +.

function figure6(s) {
    // replace any character from 1-9 with '!'
    return s.rereplace("[0-9]+", "!");
}

result = figure6("Example 1");
writeoutput(result); // Example !
result = figure6("Example 10");
writeoutput(result); // Example !

In regular expressions, a + character means match one or more of the preceding element. As such we are saying match one or more of any character in the range 0 to 9 ([0-9]). This also means that our regular expression of [0-9]+ will work with 100 or 12345.

function figure7(s) {
    // replace one or more characters from 0-9 with '!'
    return s.rereplace("[0-9]+", "!");
}

result = figure7("Example 1");
writeoutput(result); // Example !
result = figure7("Example 10");
writeoutput(result); // Example !
result = figure7("Example 9876543210");
writeoutput(result); // Example !

Bracket ranges don’t just work with integers, you can use them with letters as well.

function figure8(s) {
    // replace one or more characters in the bracket expression with '!'
    return s.rereplace("[a-z]+", "!");
}

result = figure8("Example 1");
writeoutput(result); // E! 1
result = figure8("Example 10");
writeoutput(result); // E! 10
result = figure8("Example 9876543210");
writeoutput(result); // E! 9876543210

This time we are replacing one or more characters in the range [a-z]. Note that it is case-sensitive, so doesn’t match on the E.

We can match uppercase and lowercase characters by using reReplaceNoCase or we can actually add another range to the bracket expression to match those uppercase characters.

function figure9(s) {
    // replace one or more characters in the bracket expression with '!'
    return s.rereplace("[a-zA-Z]+", "!");
}

result = figure9("Example 1");
writeoutput(result); // ! 1
result = figure9("Example 10");
writeoutput(result); // ! 10
result = figure9("Example 9876543210");
writeoutput(result); // ! 9876543210

Now we are matching one of more of either lowercase characters a-z or uppercase characters A-Z without having to use ReReplaceNoCase.

I think that’s enough for one blog post – but before I end I want to mention that when I first started using regular expressions I could never remember things like what the special character for specific matches were, so instead I’d often write them using an alternative syntax. That syntax uses curly braces to define a quantifier of how many matches we want like so: {mincount,maxcount}.

As we want to match one or more, we can write that as {1,}. We don’t specify the max count (the 2nd parameter) as we don’t have a maximum limit, all we are worried about is matching at least 1.

In the following figure10 I’ve substituted the special character + with {1,}. They both mean the same thing, namely – match one or more.

function figure10(s) {
    // replace one or more characters in the bracket expression with '!'
    return s.rereplace("[a-zA-Z]{1,}", "!");
}

result = figure10("Example 1");
writeoutput(result); // ! 1
result = figure10("Example 10");
writeoutput(result); // ! 10
result = figure10("Example 9876543210");
writeoutput(result); // ! 9876543210

As I mentioned above, when I was getting started with regular expressions I found this syntax much easier to get my head around to read and write rather than trying to remember that + meant match one or more as there are several other special characters for quantifiers in regular expressions. These days, I opt for the + syntax, but thought I share the alternative syntax in case it helps you get started.

Hopefully this post has been useful!

Runnable examples here:

https://cffiddle.org/app/file?filepath=aa566c5c-3e39-404d-9faf-8aed5d643d5c/3cad0afc-4f07-4070-8cfd-5b1c2d566642/f3af0e46-c521-4370-a395-907f40f52e89.cfm

The post Regular expressions – practical examples to get you started appeared first on ColdFusion.

Read Full Article

Read for later

Articles marked as Favorite are saved for later viewing.
close
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Separate tags by commas
To access this feature, please upgrade your account.
Start your free month
Free Preview