House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

query of query strange error

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
fun and learning
05/22/2012 02:44 PM

Hi All- I am facing a strange error with query of query as follows: I am first constructing a query using 'QueryNew' as <Cfset newQuery = QueryNew("id, status, label, name")> the status column is a numeric column in database with values of 1,2,3,4,5,6 and NULL When I do a query of query as below, I get an error 'The value '' cannot be converted to a number'. This does not happen always: <cfquery dbtype="query" name="qoq">    select * from newQuery </cfquery> ANy thoughts on why this could be happening?

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Christopher Watson
05/22/2012 02:47 PM

Use the optional second argument to QueryNew to explicitly define the data types for each column. -Christopher ----- Excess quoted text cut - see Original Post for more -----    > select * from newQuery > </cfquery> > > ANy thoughts on why this could be happening?

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Quan Tran
05/23/2012 04:49 PM

How are you setting the value on the query when the value is null from the database? I think you may need to use javacast("NULL",0) if you keep the column as a numeric type. -Quan ----- Excess quoted text cut - see Original Post for more -----    > select * from newQuery > </cfquery> > > ANy thoughts on why this could be happening?


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference