rfwoolf
asked on
Take a result set and cast a column as BOOLEAN - the field MUST be Boolean
I have a database table in Firebird which doesn't have a Boolean datatype, so the fiels is actually of type VARCHAR(5) and the values are all "True" and "False" (strings).
Unfortunately my application uses a 3rd party component which no longer works now that the fields aren't Boolean - I think it HAS TO MAP to Boolean fields.
I've already spent about 5 hours going through hundreds of lines of code trying to rewire it to accept the VARCHAR fields - WHEN I HAD AN IDEA - couldn't I have some kind of a temporary DataSet where I could pump the resultset so that the column is BOOLEAN?
The only way that *I* know how to do this would be to set up a table in ANOTHER database like MSaccess or BDE and pump the data there - do you know of a better way?
Unfortunately my application uses a 3rd party component which no longer works now that the fields aren't Boolean - I think it HAS TO MAP to Boolean fields.
I've already spent about 5 hours going through hundreds of lines of code trying to rewire it to accept the VARCHAR fields - WHEN I HAD AN IDEA - couldn't I have some kind of a temporary DataSet where I could pump the resultset so that the column is BOOLEAN?
The only way that *I* know how to do this would be to set up a table in ANOTHER database like MSaccess or BDE and pump the data there - do you know of a better way?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
typically boolean is really a smallint that only holds 2 values
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks so much for some very interesting solutions - somosnones the calculated field idea is a great one - I'm yet to try it - and rather disappointed that I didn't think of that myself. Actually I did list it as one of the things to try but never got round to it
-ciuly I have tried the CAST AS function and can't get it to work - I think it's only for the WHERE clause e.g. WHERE (CAST MyStringField AS DATE) = 01/10/2008
-Geert Gruwez - so glad I found out that FIB components can do TFields that are decendants of TBooleanFields - that is a GREAT find - unfortunately the cost of the components will take a VERY SIGNIFICANT chunk from my renumeration - but I'm thinking about it.!!!
Thanks so much - I will get back to you as soon as I can try it...
-ciuly I have tried the CAST AS function and can't get it to work - I think it's only for the WHERE clause e.g. WHERE (CAST MyStringField AS DATE) = 01/10/2008
-Geert Gruwez - so glad I found out that FIB components can do TFields that are decendants of TBooleanFields - that is a GREAT find - unfortunately the cost of the components will take a VERY SIGNIFICANT chunk from my renumeration - but I'm thinking about it.!!!
Thanks so much - I will get back to you as soon as I can try it...
ASKER
Thanks for all the help!
ASKER
Thanks for all the help. In the end I went with a Calculated Field idea from somosnones. The FIB components would have been easier but they cost too much.
I finally did get my 3rd party components working but it has taken me a week!!! :D
I finally did get my 3rd party components working but it has taken me a week!!! :D