macromedia.coldfusion.flash_integration
[Top] [All Lists]

CF and Flex Unexpected data type change

Subject: CF and Flex Unexpected data type change
From: "MarsupialsDo" <webforumsuser@xxxxxxxxxxxxxx>
Date: Mon, 12 May 2008 22:39:36 +0000 (UTC)
Newsgroups: macromedia.coldfusion.flash_integration

My apologies in advance for a long post.

 I have a Flex application that talks to either a SQL Server or Oracle database 
through ColdFusion.  One screen has a datagrid which is bound to a query 
returned by a function contained in a cfc.  A number of the columns are 
integers to be used as flags (0 or -1), and there are checkboxes on the screen 
bound to these columns.  When I call the function with a connection to SQL 
Server, I receive the data in Flex with the data type I expect - string for 
descriptive fields, and int for the integers.  When I call the same function 
with a connection to an Oracle database, all of the data is of type string.  
Yes, I have confirmed that the table is defined correctly in the Oracle 
database.  Also, dumping the metadata of the query from CF shows that the 
numeric fields are numeric, and the string fields are string; however, 
examining the ResultEvent.result in the handler shows that all of the values 
have been sent back to Flex as strings (performing the same check in SQL Server 
reveals that the fields are of the expected data type).  The end result is that 
the checkboxes always appear to be checked when connected to Oracle, but the 
checkboxes follow the data when connected to SQL Server.

 Has anyone else seen anything like this?  Am I missing something painfully 
obvious?

 Thanks in advance,

 Leighton

 <cffunction name="GetUsers" returntype="query">
        <CFQUERY name="qry" datasource="#connection_string#">
                SELECT 0 AS BNEW, USERID, USERNAME, USERPASSWORD, USERADMIN, 
USERINACTIVE,
                LNAME, FNAME, SHORT_NAME, BADGE_NUMBER, EXTERNAL_ID, 
MOBILE_USER, 
USER_GROUP_ID 
                FROM TBLUSER
                ORDER BY USERNAME
        </CFQUERY>
        <cfreturn qry>
 </cffunction>
 <!--- BNEW, USERID, USERADMIN, USERINACTIVE, MOBILE_USER, and USER_GROUP_ID 
are all defined as integer; the remainder are strings --->


<Prev in Thread] Current Thread [Next in Thread>