Mine's pretty much like yours. I'll go simple for a simple query, but I
indent everything everywhere for anything more than a simple SELECT
statement. 

-----Original Message-----
From: Peterson, Chris [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 01, 2007 2:14 PM
To: CF-Talk
Subject: Formatting your SQL Statements

I just want a quick 'style survey' on how folks key in SQL inside of CF.
Do you use a lot of white space for easy readability, or do you cram
everything onto 1 line with no aliased tables for streamlined efficiency?
For example, here is one of mine:

        <cfquery name="getData" datasource="#arguments.dsn#">
        SELECT
                UNUNIT as TractorCode,
                UNSER as Vin,
                UNMAKE as Make,
                UNPLAT as Plate,
                UNDV## as Division,
                'Company' as Type,
                UNSUPR as Supervisor
        FROM
                UNITS
        WHERE
                UNOWN IN ('','WC','ITDS','ATDS')
                AND UNDEL <> 'D'
                AND UNDV## <> ''
        
        UNION ALL
        
        SELECT
                UNUNIT as TractorCode,
                UNSER as Vin,
                UNMAKE as Make,
                UNPLAT as Plate,
                UNDV## as Division,
                'Owner Operator' as Type,
                UNSUPR as Supervisor
        FROM
                UNITS
        WHERE
                UNOWN NOT IN ('','WC','ITDS','ATDS')
                AND UNTERM = 0
                AND UNDEL <> 'D'
                AND UNSTAT <> 'U'
                AND UNDV## <> ''

        ORDER BY 
                TractorCode ASC         
                        </cfquery>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271183
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to