In ADO, when issuing SELECT * FROM WHERE FIELDACTIVE = TRUE, this will work under MySQL but will fail under MSSQL, as requieres 'TRUE', with ' required.
How do I write all sql commands for being compatible for all RDBMS?.
Thank you.
Elvira,
Try SELECT * FROM WHERE FIELDACTIVE = 1 or SELECT * FROM WHERE FIELDACTIVE = 0
I agree with AHF
Mr. Nages,
And this will be valid for all RDMBS?.
Elvira,
As far as I know besides ADS there inst any support in any SQL server for Boolean type.
Normally we use Number (Oracle) or Bit all others so I think it would be safe to use 1 or 0.
Works for those RDBMSs which support BIT datatype to represent boolean values, eg mssql, mysql, access, etc. that too if you choose BIT datatype for the field to represent boolean values. ADO recognizes these BIT fields as adBoolean,
Well known exception is Oracle, which does not have BIT or BOOLEAN field type. With oracle, I personally use NUMBER field with 1 or 0. But when we work with tables created by others, we should keep in mind that the general practice of Oracle community for ages is to use 'Y' and 'N'. (I consider this unsafe and also experienced it. But we can't change their age old habits)
I understand Postgre has a boolean field type. Not sure about postgre, informix, etc
Personally I use =0 or <> 0 instead of =0 and =1.