SQL CASE STATEMENTS
Can I use case statements within a QoQ? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318163 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: SQL CASE STATEMENTS
If you're referring to something like the following, then sure: cfquery dbtype=query select stuff from stuff where cfswitch expression=#var# cfcase value=7 things = 2 /cfcase cfdefaultcase things = 1 /cfdefaultcase /cfswitch /cfquery On Mon, Jan 19, 2009 at 8:19 AM, Torrent Girl torrentg...@gmail.com wrote: Can I use case statements within a QoQ? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318164 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: SQL CASE STATEMENTS
If you mean SQL case statements, no. On Mon, Jan 19, 2009 at 9:19 AM, Torrent Girl torrentg...@gmail.com wrote: Can I use case statements within a QoQ? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318165 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: SQL CASE STATEMENTS
I don't believe you can use T-SQL case statements in a QofQ. -Original Message- From: Torrent Girl [mailto:torrentg...@gmail.com] Sent: Monday, January 19, 2009 8:19 AM To: cf-talk Subject: SQL CASE STATEMENTS Can I use case statements within a QoQ? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318167 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: SQL CASE STATEMENTS
CASE is part of core SQL, not an MS extension in T-SQL. But not supported by QofQ either way. Write to your local Adobe rep today!! cheers, barneyb On 1/19/09, Andy Matthews li...@commadelimited.com wrote: I don't believe you can use T-SQL case statements in a QofQ. -Original Message- From: Torrent Girl [mailto:torrentg...@gmail.com] Sent: Monday, January 19, 2009 8:19 AM To: cf-talk Subject: SQL CASE STATEMENTS Can I use case statements within a QoQ? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318170 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
CF7 trim/padding of sql case statements
Hi all, We're in the midst of converting our application from CF5 to CF7 and are experiencing an interesting problem with how its interpreting case statements in our sql. The same code (as well as same Oracle database) is runs fine in CF5, but not in CF7. Below is an example of a query we have. Pay particular attection to the case statement. . . . cfquery name=test datasource=#datasource# SELECT a.TM_NM AS teamName, b.stnd_rnk AS standingRank (case when b.qry_param LIKE '%wddx%' then 'wddx' else 'paramString' end) as QueryDataType FROMteam a, standing b WHERE a.team_id = b.team_id AND b.QUERY_DSPLD_IND = 'Y' ORDER BYa.TM_NM DESC /cfquery When doing a cfoutput in CF5 on the QueryDataType variable, we get wddx or paramString. However in CF7 an extra space is added on to the end. So if we append 123 on the end, we get wddx 123 or paramString 123. Before we thought it was just with any column, but it appears to the ones that are in the case statments. Its bascially forcing us to do the trim on the coldfusion side, because once we do that it works fine. Has anyone else experienced this? Is there something that could be wrong with the database drivers causing this issue? Thanks! ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:265865 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: CF7 trim/padding of sql case statements
Just an update as I'm continuing to research. . . it seems to be any user created column, not just case statments. For example the following query also pads one space on the end of each created column. . . cfquery name=test datasource=#dataSource# SELECT '0' as level, 'Runs Total' as name, 'NYY' as code FROM table /cfquery cfoutput query=test#level#123br //cfoutput Results in MX: 0 123 Results in CF5: 0123 However if the column level is actually in the database. .. we can trim within the sql and we get the expected results when we output the query. While we're only noticing in MX, it still may be a driver issue. ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:265873 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4