Solo por si a alguien interesa ver como quedo finalmente el asunto adjunto las vistas reales que genera automáticamente el programa.
Vista que no funciona
Código:
CREATE VIEW "view_equipments" AS SELECT
equipments.idx AS idx,
equipments.tag AS tag,
equipments.desc AS desc,
eqmcls.name AS type,
pids.name AS pid,
documents.name AS mr,
equipments.flowr AS flowr,
engunits.name AS fwuom,
equipments.press AS press,
engunits.name AS psuom,
equipments.phead AS phead,
engunits.name AS phuom,
equipments.dpres AS dpres,
engunits.name AS dpuom,
equipments.dtemp AS dtemp,
equipments.dtuom AS dtuom,
drivers.name AS driver,
equipments.dvrpw AS dvrpw,
engunits.name AS pwuom,
equipments.wtdry AS wtdry,
equipments.wtwet AS wtwet,
equipments.wtuom AS wtuom,
equipments.xsize AS xsize,
equipments.ysize AS ysize,
equipments.zsize AS zsize,
equipments.szuom AS szuom,
equipments.remark AS remark
FROM equipments
LEFT JOIN eqmcls ON equipments.type=eqmcls.idx
LEFT JOIN pids ON equipments.pid=pids.idx
LEFT JOIN documents ON equipments.mr=documents.idx
LEFT JOIN engunits ON equipments.fwuom=engunits.idx
LEFT JOIN engunits ON equipments.psuom=engunits.idx
LEFT JOIN engunits ON equipments.phuom=engunits.idx
LEFT JOIN engunits ON equipments.dpuom=engunits.idx
LEFT JOIN drivers ON equipments.driver=drivers.idx
LEFT JOIN engunits ON equipments.pwuom=engunits.idx
ORDER BY equipments.idx,equipments.tag ASC
Vista que si funciona
Código:
CREATE VIEW IF NOT EXISTS "view_equipments" AS SELECT
equipments.idx AS idx,
equipments.tag AS tag,
equipments.desc AS desc,
eqmcls.name AS type,
pids.name AS pid,
documents.name AS mr,
equipments.flowr AS flowr,
A01.name AS fwuom,
equipments.press AS press,
A02.name AS psuom,
equipments.phead AS phead,
A03.name AS phuom,
equipments.dpres AS dpres,
A04.name AS dpuom,
equipments.dtemp AS dtemp,
equipments.dtuom AS dtuom,
drivers.name AS driver,
equipments.dvrpw AS dvrpw,
A05.name AS pwuom,
equipments.wtdry AS wtdry,
equipments.wtwet AS wtwet,
equipments.wtuom AS wtuom,
equipments.xsize AS xsize,
equipments.ysize AS ysize,
equipments.zsize AS zsize,
equipments.szuom AS szuom,
equipments.remark AS remark
FROM equipments
LEFT JOIN eqmcls ON equipments.type=eqmcls.idx
LEFT JOIN pids ON equipments.pid=pids.idx
LEFT JOIN documents ON equipments.mr=documents.idx
LEFT JOIN engunits A01 ON equipments.fwuom=A01.idx
LEFT JOIN engunits A02 ON equipments.psuom=A02.idx
LEFT JOIN engunits A03 ON equipments.phuom=A03.idx
LEFT JOIN engunits A04 ON equipments.dpuom=A04.idx
LEFT JOIN drivers ON equipments.driver=drivers.idx
LEFT JOIN engunits A05 ON equipments.pwuom=A05.idx
ORDER BY equipments.idx,equipments.tag ASC