Real Data Type Empty
Hi,
I'm ultimately trying to write a process to take data from an Apache Derby database and insert it into SQL Server 2008. Everything has been working fine until I started working with the ows table FILMS, which has a numeric/real column of AMOUNTBUDGETED. I'm running the following query to retrieve the data:
<cfquery name="getFilms" datasource="ows">
SELECT FILMID, MOVIETITLE, PITCHTEXT, AMOUNTBUDGETED, RATINGID, SUMMARY, IMAGENAME, DATEINTHEATERS
FROM FILMS
</cfquery>
If I <cfloop> through getFilms and use <cfoutput> to display AMOUNTBUDGETED, it displays the data. However, when I actually go to insert AMOUNTBUDGETED into SQL Server it acts as if no value is being found for AMOUNTBUDGETED. So, I ran the following test:
<cfloop query="getFilms">
<cfset budget = getFilms.AMOUNTBUDGETED>
<cfoutput>
#budget#<br/>
</cfoutput>
</cfloop>
This works fine and displays the field correctly. However, if I run the following code, I get the following error:
<cfloop query="getFilms>
<cfset budget = getFilms.AMOUNTBUDGETED * 1.00>
</cfloop>
The value '' cannot be converted to a number.
The error occurred in C:\ColdFusion9\wwwroot\ows\Utilities\films.cfm: line 8
6 : 7 : <cfloop query="getFilms"> 8 : <cfset budget = getFilms.AMOUNTBUDGETED * 1.00> 9 : </cfloop> 10 :
If I use <cfoutput>, ColdFusion can find the value for AMOUNTBUDGETED, but if I try to do anything else it can't seem to find the value. Needless to say, this is causing problems when I try to insert the value for AMOUNTBUDGETED into Sql Server. Any suggestions would be appreciated.
Thanks.
