Skip to main content
June 6, 2008
Question

Bind converts yes/no to true/false

  • June 6, 2008
  • 2 replies
  • 404 views
I am using a CFSELECT populated with a BIND to a CFC from a database in which yes and no are string values. The BIND renders the yes/no into Boolean true/false when the bind executes. I did not choose to use yes/no and am stuck with it, is there a way to correct this activity on the part of the BIND function?
This topic has been closed for replies.

2 replies

June 10, 2008
Well I have found a work-around to this problem.

In the CFQUERY I concatenate a space to the problem field, then use the trim() function to remove it before updates and the like in other CFQUERIES.
Participating Frequently
June 6, 2008
What would you prefer it to be rather than yes/no true/false? You might consider using a CASE statement in your query to convert your yes/no to something else.

Phil
June 6, 2008
Well the value in the database is yes or no, that is what I would like to see in the select statement. If I populate the select statement with the query results directly it does appear as yes or no, it is when I use a bind statement to populate it that the underlying JAVA converts the yes/no to true/false.

This becomes a problem when I use that value to modify the database with unless I convert them individually back to yes or no the database will end up with true/false and as I could theorticlly have true/false as valid data in another field I do not want to blanket catch true/false and convert them...

What would be nice is if the bind brought over the data verbatum instead of converting it....