boolean in SQL 
Author Message
 boolean in SQL

I have finished application useing BDE and Paradox table. After all I
wanted to change engine to other. It is MySQL + ODBC. Now there is no
more suport for SQL statements like:
"select * from TableName"
"where record_saved = true"

record_saved is ftBoolean type. MySQL returns error:

Quote:
>> true - invalid column name<<.

ftBoolean is converted to TINYINT(1).
How can I overcome this, and make my app to work with no big changes. Is
there an interface I can modyfy 'true -> 0' ?

--
Posted via http://www.*-*-*.com/



Fri, 23 Dec 2005 16:13:52 GMT  
 boolean in SQL
select * from TableName
where record_saved = 1

--
With best regards, Mike Shkolnik

http://www.scalabium.com



Quote:

> I have finished application useing BDE and Paradox table. After all I
> wanted to change engine to other. It is MySQL + ODBC. Now there is no
> more suport for SQL statements like:
> "select * from TableName"
> "where record_saved = true"

> record_saved is ftBoolean type. MySQL returns error:
> >> true - invalid column name<<.

> ftBoolean is converted to TINYINT(1).
> How can I overcome this, and make my app to work with no big changes. Is
> there an interface I can modyfy 'true -> 0' ?

> --
> Posted via http://dbforums.com



Fri, 23 Dec 2005 19:00:55 GMT  
 boolean in SQL

select * from TableName
where record_saved = 1

With best regards, Mike Shkolnik

It is simple but not so easy to do. We have many GUI/form's and SQL
statemenst. And this will block BDE and Paradox. It is not flexible.

but THX

--
Posted via http://dbforums.com



Fri, 23 Dec 2005 19:48:51 GMT  
 boolean in SQL


Quote:

> select * from TableName
> where record_saved = 1

> With best regards, Mike Shkolnik

> It is simple but not so easy to do. We have many GUI/form's and SQL
> statemenst. And this will block BDE and Paradox. It is not flexible.

Interbase/Firebird do not support boolean either. I wonder how
many SQL servers do support it?
Get the GReplace utility. Makes specified global substitutions
in *.pas and *.dfm files thoughout a project.

PR



Sat, 24 Dec 2005 11:08:43 GMT  
 boolean in SQL

Quote:



> > select * from TableName
> > where record_saved = 1

> > With best regards, Mike Shkolnik

> > It is simple but not so easy to do. We have many GUI/form's and SQL
> > statemenst. And this will block BDE and Paradox. It is not flexible.

> Interbase/Firebird do not support boolean either. I wonder how
> many SQL servers do support it?

I believe that IB/7 support  "boolean".

Anyway, if boolean is supported one should not be required to write

Quote:
> where record_saved = true

... where record_saved ... should be sufficient.

--
Aage J.



Sat, 24 Dec 2005 14:56:50 GMT  
 boolean in SQL



Quote:

> select * from TableName
> where record_saved = 1

Better (this works allways):
select * from TableName
where record_saved <> 0

Quote:
> It is simple but not so easy to do. We have many GUI/form's and SQL
> statemenst. And this will block BDE and Paradox. It is not flexible.

You have to modify all queries:

WHERE booleanfield=True   ==>   WHERE booleanfield<>0
WHERE booleanfield=False  ==>   WHERE booleanfield=0

Andreas



Tue, 27 Dec 2005 00:16:49 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Boolean in SQL with Paradox DB

2. SQL-Typecasting to boolean ?

3. BDE, dBASE, SQL, and Logical fields (boolean)

4. boolean question

5. Boolean RANGE

6. Q: Does Interbase have a boolean variable?

7. MSAccess97 boolean fields being returned as smallints??

8. Interbase, Boolean types, and dbCheckBox

9. Boolean Variables

10. Boolean

11. Help, I'm Stuck in Boolean Reality

12. Boolean

 

 
Powered by phpBB® Forum Software