[firebird-support] query with no result

2017-11-23 Thread alauren...@gmail.com [firebird-support]
Hi! I have a query with no results and I doo't understand what I do wrong: SELECT DENSUB, CODSUB from SUBANS,TEMPSUB WHERE SUBANS.CODSUB=TEMPSUB.CODSBB AND SUBANS.CODSUB NOT IN (SELECT CODSBB FROM TEMPSUB) AND SUBANS.CODPF='FL1' order by SUBANS.DENSUB asc The query must return some

[firebird-support] Structure Chart - Moving subtree in a closure table

2017-11-23 Thread talorigo...@yahoo.co.uk [firebird-support]
I'm using a closure table to manage an organisation structure. The organisation table is defined as: CREATE TABLE ORGANISATION ( ORGID DOM_INTLARGE NOT NULL, ORG_NME DOM_VARCHARMEDIUM NOT NULL, LEVEL_NUM DOM_INTSMALL NOT NULL, INUSE DOM_BOOLN, CONSTRAINT PK_ORGANISATION PRIMARY KEY