user3062776
user3062776

Reputation: 167

WITH statement in JOOQ?

I have query for MS-SQL and Oracle but I want to convert into Jooq .I also trying somthing like this DSL.connectByRoot(field) But I am unable to find this solution . The main issue is that in Oracle we use clause connect by prior but its not available in MS-SQL.

MS-SQL QUERY:

WITH tempTable(ppCode, pCode) AS (
  SELECT DefaultProcessDependent.PriorProcessCode,  ProcessCode 
  FROM DefaultProcessDependent
  WHERE DefaultProcessDependent.ProcessCode = ? 
  AND DefaultProcessDependent.FolderType  = ? 
  UNION ALL
  SELECT nplus1.PriorProcessCode, nplus1.ProcessCode
  FROM DefaultProcessDependent as nplus1, tempTable
  WHERE tempTable.ppCode = nplus1.ProcessCode
)
SELECT ppCode FROM tempTable

ORACLE QUERY:

Select processCode 
from DefaultProcessDependent 
start with  DefaultProcessDependent.ProcessCode = ? 
connect by prior processCode = priorProcessCode

Anyone help me please...................

Thanks

Upvotes: 1

Views: 144

Answers (1)

Lukas Eder
Lukas Eder

Reputation: 221195

Common table expressions will be supported with jOOQ 3.4. jOOQ will also emulate CONNECT BY for other databases, but that won't be available in jOOQ 3.4 yet.

Upvotes: 1

Related Questions