![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi I have the following build problem with SQL executing the following. (Conversion MSSQL to DB2) The simplified code does the following(SQL0345N) DB2 Verson is DBUDB9.7(Fix1) WITH CTE_Tree(Seq1, Seq2,Type, TypeSeq, ItemSeq,CostType,Sort, Level) AS ( SELECT A.Seq1, A.Seq2, A.Type, A.TypeSeq, A.itemSeq, A.CostType, A.Sort, A.Level FROM dbo."FORMTREE" A WHERE A.Seq1 = 1 AND A.Seq2 = 1277 AND A.TypeSeq = 2 AND A.ItemSeq = 926 AND A.CostType = 0 UNION ALL SELECT A.Seq1, A.Seq2, A.Type, A.TypeSeq, A.itemSeq, A.CostType, A.Sort, A.Level FROM dbo."FORMTREE" A INNER JOIN CTE_Tree CTE ON A.TypeSeq = CTE.TypeSeq AND A.ItemSeq = CTE.ItemSeq AND A.CostType = CTE.CostType WHERE A.Seq1 = 1 AND A.Seq2 = 1277) select Seq1,Seq2 from CTE_Tree --->SQL0345N The fullselect of the recursive common table expression " CTE_Tree" must be the UNION of two or more fullselects and cannot include column functions, GROUP BY clause, HAVING clause, ORDER BY clause, or an explicit join including an ON clause. Can't I change MSSQL code to DB2?? Is dbo a valid schema name in your database |
#3
| |||
| |||
|
|
Hi I have the following build problem with SQL executing the following. (Conversion MSSQL to DB2) The simplified code does the following(SQL0345N) DB2 Verson is DBUDB9.7(Fix1) WITH CTE_Tree(Seq1, Seq2,Type, TypeSeq, ItemSeq,CostType,Sort, Level) AS ( SELECT A.Seq1, A.Seq2, A.Type, A.TypeSeq, A.itemSeq, A.CostType, A.Sort, A.Level FROM dbo."FORMTREE" A WHERE A.Seq1 = 1 AND A.Seq2 = 1277 AND A.TypeSeq = 2 AND A.ItemSeq = 926 AND A.CostType = 0 UNION ALL SELECT A.Seq1, A.Seq2, A.Type, A.TypeSeq, A.itemSeq, A.CostType, A.Sort, A.Level FROM dbo."FORMTREE" A INNER JOIN CTE_Tree CTE ON A.TypeSeq = CTE.TypeSeq AND A.ItemSeq = CTE.ItemSeq AND A.CostType = CTE.CostType WHERE A.Seq1 = 1 .... |
#4
| |||
| |||
|
#5
| |||
| |||
|
#6
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |