To be 'true' or 'false', but returning null

34 views
Skip to first unread message

hamacker

unread,
Jul 18, 2024, 2:01:29 PM7/18/24
to firebird...@googlegroups.com
Using LI-V5.0.0.1306 Firebird 5.0  on Linux, connection client as localhost and xnet using ibexpert and lazarus+zeos, I try:
       select * from rm_itens a
       where (a.status='A')
        and (a.criacao_grupo in ('INFORMATICA','OBRAS'))

And 4 records found, but when I try:
SELECT
  CASE
    WHEN exists(
       select * from rm_itens a
       where (a.status='A')
        and (a.criacao_grupo in ('INFORMATICA','OBRAS'))
    )
    THEN true
    ELSE false
  END AS EXISTE
FROM RDB$DATABASE;
Column EXISTE returning null, why?

Karol Bieniaszewski

unread,
Jul 18, 2024, 2:45:08 PM7/18/24
to firebird...@googlegroups.com

Try first with simple type instead of True an False try ‘T’, ‘F’

if it is working then you tool do not support native boolean datatype

 

Regards,

Karol Bieniaszewski

--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/CAA09Jk9OG-OAcUe-RCwN_SWrDbRDXAqbFsd0W1B9GfaR03qAGQ%40mail.gmail.com.

 

hamacker

unread,
Jul 18, 2024, 4:23:18 PM7/18/24
to firebird...@googlegroups.com
eureka! I discovered the problem.
I don't know why, but RDB$DATABASE is empty!
Probably, something goes wrong when I copy a database file from the replication side to my desk.
I copied it again, and now everything is fine.

gkvi...@gmail.com

unread,
Jul 19, 2024, 9:58:27 AM7/19/24
to firebird-support
Did you copy the database file when is not in use/all connections closed? A file copy of a database where are in use, are allways corrupt

hamacker

unread,
Jul 19, 2024, 12:48:10 PM7/19/24
to firebird...@googlegroups.com
I copy from the replication server where the database is read only, asynchronous, updated hour by hour from the real server.
scp root@fbrepserver:/var/fdb/*.fdb /home/p/fdb/
chown firebird:firebird database.fdb
gfix -replica none database.fdb

No errors found in any table.
Only the RDB$DATABASE table, which should always have 1 record, was empty, I don´t know why.
Just copy again and now it is solved.


Reply all
Reply to author
Forward
0 new messages