Subject CTE query works on fb 2.5 but not on fb 3.0
Author Rudi Feijó
Good afternoon.
I’ve been assigned to debug a query that was working on 2.5 but stopped
workin on 3.0.



As of now I have little information on the context of where this query is
used, but I’m assuming it might be something simple.



Apparently what’s causing the error is using this FROM sintax with multiple
tables separated by comma (FROM tablea, tableb, tablec).

I’m assuming that because the error is always thrown on the line subsequent
to the “from” line


Was there any change to this type of from syntax in firebird 3.0?
Below is the query. If needed I can create a test gdb with data.

Thanks in advance







with recursive sucessoras (task_id) as

(

select prj_task_dependencies.dependencies_task_id as task_id

from prj_task_dependencies

inner join prj_tasks t_req on t_req.task_id =
prj_task_dependencies.dependencies_req_task_id

and t_req.task_status = 0

inner join prj_tasks t_dep on t_dep.task_id =
prj_task_dependencies.dependencies_task_id

and t_dep.task_status = 0

where prj_task_dependencies.dependencies_req_task_id = 98

union all

select

prj_task_dependencies.dependencies_task_id as task_id

from prj_task_dependencies, sucessoras

inner join prj_tasks t_req on t_req.task_id =
prj_task_dependencies.dependencies_req_task_id

and t_req.task_status = 0

inner join prj_tasks t_dep on t_dep.task_id =
prj_task_dependencies.dependencies_task_id

and t_dep.task_status = 0

where prj_task_dependencies.dependencies_req_task_id =
sucessoras.task_id

)



select



distinct(sucessoras.task_id) ,

t.idbpo_proc,

t.task_name,

t.task_project as idclienteprojeto,

t.task_constraint,

t.task_constraint_date,

t.TASK_BASELINE_DURATION as THIS_TASK_BASELINE_DURATION,

t.TASK_BASELINE_DURATION_D as THIS_TASK_BASELINE_DURATION_D,

t.TASK_DURATION_TYPE as THIS_TASK_DURATION_TYPE,

t.task_baseline_start as THIS_TASK_BASELINE_START,

t.task_baseline_end as THIS_TASK_BASELINE_END,



cast(t.task_baseline_start as time) as
THIS_TIME_TASK_BASELINE_START,

cast(t.task_baseline_end as time) as THIS_TIME_TASK_BASELINE_END,



t.recorrencia_semanal_domingo,

t.recorrencia_semanal_segunda,

t.recorrencia_semanal_terca,

t.recorrencia_semanal_quarta,

t.recorrencia_semanal_quinta,

t.recorrencia_semanal_sexta,

t.recorrencia_semanal_sabado,



(select max(t_req.task_baseline_end)

from prj_task_dependencies td

inner join prj_tasks t_req on t_req.task_id =
td.dependencies_req_task_id

and t_req.task_status = 0

inner join prj_tasks t_dep on t_dep.task_id =
td.dependencies_task_id

and t_dep.task_status = 0

where td.dependencies_task_id = sucessoras.task_id) as
PRED_TASK_BASELINE_END



from prj_task_dependencies , sucessoras , prj_tasks t

inner join prj_tasks t_req on t_req.task_id =
prj_task_dependencies.dependencies_req_task_id

and t_req.task_status = 0

inner join prj_tasks t_dep on t_dep.task_id =
prj_task_dependencies.dependencies_task_id

and t_dep.task_status = 0

where prj_task_dependencies.dependencies_task_id =
sucessoras.task_id

and t.task_id = sucessoras.task_id







Atenciosamente,

Rudi Feijó


Multidados Informática Ltda.
* (11) 2579-8794 / 2579-8795
* <mailto:ariane.cutlac@...> rudi.feijo@...
* <http://www.multidadosti.com.br/> www.multidadosti.com.br
<http://www.timesheet.com.br/> www.timesheet.com.br





[Non-text portions of this message have been removed]