ComputingComputer ScienceCompilersDatabasesProgramming LanguagesCompiler Back EndsCompiler ConstructionControl-flow AnalysisData-flow AnalysisQuery ProcessingStructured Query LanguageCommon Table ExpressionsControl Flow ControlIntermediate Code GenerationSql Query LanguagesUser-defined Functions
We demonstrate a source-to-source compilation technique that can translate user-defined PL/SQL functions into plain SQL queries. These PL/SQL functions may feature arbitrarily complex control flow-iteration, in particular. From this imperative-style input code we derive equivalent recursive common table expressions, ready for execution on any relational SQL:1999 back-end. Principally due to the absence of PL/SQL?SQL context switches, the output plain SQL code comes with substantial runtime savings. The demonstration embeds the compiler into an interactive setup that admits function editing while live re-compilation and visualization of intermediate code forms happens in the background.
2