Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Boolean type does not work properly on a query



Permlink Replies: 0
Patricio Cerda

Posts: 122
Registered: 3/13/01
Boolean type does not work properly on a query
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 13, 2018 9:33 AM
Hi,

I have a DataSnap application made with C++Builder Berlin 10.1 and InterBase XE7, where the user could insert successfully records on a Usuarios table. Those records include a boolean type field that have a 'true' value that InterBase IBConsole shows as expected (true value). However, if I try a query filtering by that boolean field the result does not include that records no matter it's 'true' value.

Table: Usuarios
Field: Boolean Vigencia Not Null
Query: select * from USUARIOS where IDTIPOUSUARIO = 5 and VIGENCIA = :Vigencia order by NOMBRECOMPLETO asc
Params: Vigencia ftBoolean ptInput

If then I change the True value by False value with this query: "update Usuarios set Vigencia = False" and after that change again to the True value, then my application works well.

To create the records of the Usuarios table I'm using the Insert method and the specific Vigencia field value is completed this way:
DMCliente->CDS_Usuarios->FieldByName("Vigencia")->AsBoolean = true;

Why my query is no working properly at the first time without the necessary value change to False and then to True?

Any help would be appreciate.

Best regards,
Patricio Cerda
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02