A “TOP” SQL statement can be added to CFQL methods by setting the maxCount attribute on the method. Therefore, there’s no need to write raw SQL to do so, and the following LoadTopTen method:

<cf:entity name=”Artist”>
<cf:method name=”LoadTopTen” body=”load() raw”>SELECT TOP(10) * FROM Artist</cfmethod>

Can instead be written:

<cf:entity name=”Artist”>
<cf:method name=”LoadTopTen” body=”load” maxCount=”10″ />

This way you’re entirely platform independent and you can let producers translate those for you.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s