Yeah, I checked that first thing...  The value returned in a cfquery is 
nothing but the string, as it should be, indicating that the database record
is as I expect.  Something seems to be happening within one of my CFCs to
screw this up.

-----Original Message-----
From: Ryan Guill [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 08, 2005 2:23 PM
To: CF-Talk
Subject: Re: funky strings in CFCs?

try using a trim() on insert.  see how its storing it in the db, if it
has the line breaks and extra spaces there.

On 9/8/05, Paul <[EMAIL PROTECTED]> wrote:
> I'm getting results from my DAO that don't exactly match the same value
when
> retrieved using good old-fashioned cfquery.  I suspect I'm doing something
> goofy.
> 
> 
> 
> When I grab the data directly using cfquery, I can see that the value
stored
> in my database is simply "81150-100".  When I retrieve the same value
> through my DAO, the value is essentially the same but the string is
> prepended by a line break and extra spaces.  So "81150-100" is returned as
"
> 
>  81150-100"
> 
> 
> 
> Am I making, by chance, a common mistake?  If the symptoms sound familiar
to
> you I'd sure appreciate the help.  Here's what I think is the relevant
code.
> 
> 
> 
> In the calling page:
> 
>
entry=createObject("component","com.portal.amex.entryDAO").init().read(url.e
> ntryID);
> 
> dump(entry.getAccount());
> 
> 
> 
> The "read" function of my DAO:
> 
> <cffunction name="read" access="public"
returntype="com.portal.amex.entry">
> 
>       <cfargument name="entryID" required="true" type="numeric">
> 
>       <cfset var q="">
> 
>       <cfset var o=createObject("component","entry").init()>
> 
>       <cfquery name="q" datasource="#getDSN()#">
> 
>             select * from entries
> 
>             where entryID = <cfqueryparam value="#arguments.entryID#"
> cfsqltype="CF_SQL_INTEGER">
> 
>       </cfquery>
> 
>       <cfscript>
> 
>             o.setEntryID(q.entryID);
> 
>             o.setTransactionID(q.transactionID);
> 
>             o.setAccount(q.account);
> 
>             o.setAmount(q.amount);
> 
>             o.setEnteredBy(q.enteredBy);
> 
>             o.setEnteredDate(q.enteredDate);
> 
>             o.setNotes(q.notes);
> 
>       </cfscript>
> 
>       <cfreturn o>
> 
> </cffunction>
> 
> 
> 
> And the init and getAccount methods from the entry object:
> 
> <cffunction name="init" access="public" displayname="init()" output="no"
> returntype="entry">
> 
>       <cfargument name="transactionID" default="0" type="numeric">
> 
>       <cfargument name="account" default="" type="string">
> 
>       <cfargument name="amount" default="0" type="numeric">
> 
>       <cfargument name="enteredBy" default="" type="string">
> 
>       <cfargument name="enteredDate" default="#now()#" type="date">
> 
>       <cfargument name="notes" default="" type="string">
> 
>       <cfargument name="entryID" default="0" type="numeric">
> 
>       <cfscript>
> 
>             variables.instance=structNew();
> 
>             setTransactionID(arguments.transactionID);
> 
>             setAccount(arguments.account);
> 
>             setAmount(arguments.amount);
> 
>             setEnteredBy(arguments.enteredBy);
> 
>             setEnteredDate(arguments.enteredDate);
> 
>             setNotes(arguments.notes);
> 
>             setEntryID(arguments.entryID);
> 
>       </cfscript>
> 
>       <cfreturn this />
> 
> </cffunction>
> 
> 
> 
> <cffunction name="getAccount" returntype="string">
> 
>       <cfreturn variables.instance.account>
> 
> </cffunction>
> 
> <cffunction name="setAccount" returntype="void">
> 
>       <cfargument name="newValue" required="Yes">
> 
>       <cfset variables.instance.account=trim(arguments.newValue)>
> 
> </cffunction>
> 
> 
> 
> 
> 
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:217687
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to