Feb
17

Tip : Getting unsorted query columns in coldfusion

Author nerdscubecom    Category Coldfusion     Tags , , , , ,

This one gave me a headache for 15 min, making all the possible tricks to make my query return the unsorted columns.

Generally Coldfusion always sort the columns in the query that has been returned, irrespective of the order you have specified in the SQL statement. Most of the time its a blessing, but not always.

There is no documented way to get the unsorted columns otherthan using some thirdparty customtags and function. But there is a tweak for this case.

Tweak #1
Use getMetaData() function to get the column list which is as per the sql statement which you have written.

<!--- use GetMetadata to get the names and data types of the fields in the
            cfdocexamples Employees table --->
<cfquery name="getemployees" datasource="cfdocexamples">
SELECT *
FROM Employees
</cfquery>
<cfset employeemeta=getMetaData(getemployees)>
 
<h4>The Employees table has the following columns</h4>
<cfloop index="i" from="1" to="#arrayLen(employeemeta)#">
    <cfoutput>
        #employeemeta[i].name#
    </cfoutput>
</cfloop>

Tweak#2
Use queryObj.getColumnNames() function to get the unsorted list of column from the query. this function is not documented in CF docs. Thanks to Richard

<cfset queryColumnlist = ArrayToList( qryObj.getColumnNames() )>
Feb
9

Tip : Show hide columns in cfdump

Author nerdscubecom    Category Coldfusion     Tags

Small tip for the day, In Coldfusion MX7 the CFdump was pritty much dump that it just do the variable dump and nothing more.

CF8 dump is much more capable like writing the dump out to file like i did in my last blog , plus you even can control the fields that you need to show or hide during the dump. This could pretty much save time when dumping big queries which contains long columns
Continue

Jan
30

Tip : Using cfdump inside CFscript

Author nerdscubecom    Category Coldfusion     Tags , , ,

One simple tip for the day, How to use cfdump inside the cfscript block !!!

cfscript block does not support cfdump tag or indeed any tag inside it. So the trick is to create function which dumps the value using cfdump and call the function inside cfscript by passing the variable as parameter.
Continue

Jan
26

What is Augmented Reality ?

Augmented Reality or in short AR is the term used to describe the mixture of real vs Virtual.  Its the real time mixing of virtual environment to a real world.
Continue

Jan
25

Coldfusion 9 : Feature improvement history

Check out the new Coldfusion 9 feature comparison with its predecessors which includes CF8 and MX7. PDF download at the bottom of content.
Continue

Jan
25

Ask Neo: What is Digitization?

Today somebody asked me the question on the definition of Digitization specific to computer projects.

So I went back to my seat and did my googling and found some simple paragraphs defining Project Digitization.
Continue

Jan
14

TIPS : Best Practices when creating email Newsletter Part:1

Author nerdscubecom    Category HTML     Tags ,

When creating a new Newletter for your business promotion email , you have to make sure that the email is views in a vast range of borwsers, mail services and applications like Outlook and thunderbird. So i thought to consolidate some best practices that you should consider when creating a News letter. Continue

Dec
26

2009 Must watch movies

Author nerdscubecom    Category Movies     Tags , , ,

Call us greedy, but we’ve said it once, and we’ll say it again: Ten is not enough. While nearly all movie critics engage in the time-honored tradition of ranking their picks for 10 best flicks of the year, we prefer to take this time of year to recognize the admirable quantity of quality movies being produced, despite our occasional moaning that says otherwise. Therefore, like we have the past several years, we count to 50.
Continue

Dec
24

How to add dynamic rows in a table with javascript

A good web design involves the better user interaction and ability to fetch the data in a better way. For most User experience in your site, you have to ease out the user actions like form filling, searching etc.
Continue

Dec
24

Avatar : My joy ride to Pendora

Author nerdscubecom    Category Movies     Tags , , ,

avatar.jpgAvatar : The movie by James Cameron , came out to be a movie of wonder land where creatures resembling human beings ” The Na’vi’s”. They live like us , They civilize, they love and care like us.  At one point, I really started to live with them through the 3D glasses.
Continue

Connect me

Twitter

Recent Posts

Categories

Blogroll

Tags

Adventure Android augmented Augumented avatar cf8 CF9 cfdump cfquery Coldfusion Coldfusion programming technology features new compare comparison debugging Definitions design Digitization dynamic element creation form future getmetadata HTML Inspirations Iphone Javascript Jquery movie Movies mustwatch mx7 new feature programming project Project Management Reality realtime si-fi Technology tip top tricks validation virtual world web development

Archives

RSS CF Libs

  • verifyMailServer July 1, 2010
    Verifies a mail server connection. […]
  • getFunctionHint July 1, 2010
    You give me a function and I return the hint. Useful for demo and documentation pages. […]
  • getUrlRelativeToWebRoot June 23, 2010
    Pass in file path to web root and a file and it returns URL relative to site root. […]
  • getUploadData June 23, 2010
    Returns a structure containing upload information. […]
  • hexToFloat June 22, 2010
    Converts a 32-bit hexadecimal floating-point number to a java float […]
  • floatToHex June 22, 2010
    Converts a java float to a 32-bit hexadecimal representation […]
  • randomFirstName June 22, 2010
    Returns a random first name. […]
  • getLeadingHtml June 18, 2010
    Display N leading characters of a text block which may include HTML. […]
  • randomLastName June 18, 2010
    Returns a random last name. […]
Get Adobe Flash playerPlugin by wpburn.com wordpress themes