SQLScript (SAP HANA 2.0 SPS 08)

This assessment applies the coupling account — coupling as access to a shared resource, and the coupling floor [1], [2] — and the knowledge-embodiment theorem [3]; the language is assessed against its official reference [4].

Snapshot SQLScript (SAP HANA 2.0 SPS 08) — released November 2024 · lifecycle current

Family SQLScript — shelf: Data and Science

The language’s primary object is a dataset or a numeric array, not a program loop. A shelf groups; it does not classify — the tags below carry every use, paradigm, and platform of this snapshot.

Trajectory SQLScript in SAP HANA 1.0 (2010 — the data, functional, and procedural extensions ship with the in-memory engine) · SAP HANA 2.0 (November 2016 — HDI deployment and the SPS release cadence form around SQLScript) · SAP HANA 2.0 SPS 08 (November 2024 — assessed release: the SQLScript Reference document version of the newest SPS stack)

Tags

Use — Data and statistics, Query

Paradigm — Imperative, Procedural, Declarative

Lifecycle — Current

Memory — Runtime-managed

Typing — Static, strong

Resources

The language’s official entry points, and the documents that name the release this page assesses. A link marked this release pins the document to SQLScript (SAP HANA 2.0 SPS 08); an unmarked link is the current reference for the language.

Landing page

Specification and reference

1 Assessment

This page assesses SQLScript (SAP HANA Platform 2.0 SPS 08) in five parts: core coupling — what the language’s own constructs force; ecosystem coupling — what the surrounding platform, tooling, and community cost; engineering readiness — whether the artifact can be reproduced, verified, observed, worked in quickly, connected to other languages, and governed openly; the profile — the unscored facts a score cannot express; and the scoring detail — the mechanism marks and the arithmetic behind every score. A ✅ bullet marks a construct that helps. A ⚠️ or ❌ bullet marks a cost; the scoring model does not price every cost named here.

Core coupling 83.1/100 · Ecosystem coupling 81.6/100 · Engineering readiness 40.9/100

1.1 Core coupling

1.1.1 Type

  • ❌ NULL is a member of every domain: procedure parameters, locals, and table columns carry NULL unannounced, and no signature states whether a value may be absent (T10)
  • ⚠️ No sum types: an alternative is a nullable column or a table variable’s shape, and the consumer re-derives the encoding from the body
  • ❌ Statements state no effect: the reference defines the functional extension as side-effect free by intent, but the signature of a procedure states nothing about the writes, reads, or calls inside it (T12)
  • ❌ R rides an external boundary: procedures can be written in RLANG, executed by an external R environment the server calls, and the crossing between SQLScript tables and R data frames is checked by neither side’s compiler (T14)

1.1.2 Construction

  • ✅ Table variables are the unit: the data extension defines table types without tables, and procedures pass and assign table variables the optimizer can treat as sets rather than rows
  • ⚠️ The reference argues against its own imperative layer: the motivation chapter sets one-tuple-at-a-time semantics against set-oriented SQL because loops are “hard to optimize and parallelize”, so the procedural constructs carry a documented performance warning the declarative ones do not

1.1.3 Memory

  • ✅ Allocation is the engine’s: column store, delta merge, and statement memory live in the HANA process, and the SQLScript text allocates nothing

1.1.4 Error

  • ❌ The EXIT HANDLER decides, or the procedure dies: handlers catch declared conditions and SQL error codes, and without one the error leaves the procedure — no value carries the failure (Er3)
  • ❌ No composable result type: failures travel by exception and results by output table variables and result sets, and neither threads through an expression (Er4)

1.1.5 Concurrency

  • ❌ Session state is shared: session variables and temporary tables are visible across every procedure the connection calls, so two callers share what the session holds (K2)

1.1.6 Platform

  • ❌ The procedure runs only in HANA: the parser, the table-type system, and the deployment model (HDI containers) are the engine’s, and nothing in the language runs elsewhere (P1)
  • ❌ A poor fit outside the data tier: the language has no general libraries or error values, so application logic beyond data flows builds every abstraction itself (P4)

1.1.7 Trade-offs (not coupling)

  • Pushdown is the design goal: table types, set-oriented bodies, and in-engine parallelism exist to keep data from moving, and the price is that the imperative layer carries a documented optimization warning
  • Deployment is the database: HDI containers version procedures and table types as artifacts, and the price is that the application’s logic lives inside a commercial engine’s deployment model
  • Handlers are optional: EXIT HANDLER gives structured recovery against conditions and SQL error codes, and the price is that unhandled errors surface at the caller
  • Embedded R and Python buy in-database analytics: foreign-language procedures run beside SQLScript bodies, and the price is an unchecked boundary between two type systems

1.2 Ecosystem coupling

1.2.1 Performance

  • ✅ The optimizer is the point: the reference’s stated goal is pushdown with “massive parallelization”, and declarative bodies (UNION ALL with implicit parallelism, MAP_MERGE-style operations) are the constructs the engine optimizes
  • ⚠️ Imperative bodies carry a documented penalty: the reference motivates SQLScript itself by the cost of row-wise logic, and the same warning applies to loops written inside the language

1.2.2 Ecosystem

  • ❌ A proprietary stack end to end: the server, the deployment infrastructure, the IDE (Business Application Studio), and the support model are SAP products under commercial terms (Ec4)

1.2.3 Evolution

  • ⚠️ The SPS calendar governs the surface: HANA 2.0 moves in support-package stacks, and the reference’s own version selector decides which constructs a deployment’s procedures may use

1.2.4 Domain

  • ❌ The language exists to serve SAP’s data tier: procedures deploy through HDI into containers, the calculation and SQL engines define what they can say, and the S/4HANA application world is the domain (D1)

1.2.5 Learning

  • ❌ Two styles, one language: set-oriented SQL and imperative blocks share the surface, and the reference’s own guidance on when each applies is required reading before a body will perform (L2)

1.2.6 Syntax

  • ⚠️ Standard-shaped, SAP-flavored: the statements read like ISO SQL, and the table-type system, handler syntax, and deployment annotations are HANA’s own layer on top

1.2.7 Testing

  • ❌ No standard test harness for user procedures: SAP’s own QA is internal, and the documented testing story is application-side tests and the SQL analyzer against a live system (G1)

1.2.8 Security

  • ❌ Dynamic SQL is string-built: EXEC runs SQL text assembled at run time, so concatenated user input reaches the parser, and the mitigation is the privilege model plus bound inputs (Q3)

1.2.9 Delivery targets

What ships from a producer to a consumer, and whether the interface across a release boundary is promised. Ec8 is present when one compiled target crosses with no promise.

Target Ships as Crosses a producer boundary Cross-release promise
deployed procedure and function source (HDI artifacts) script no the database stores and parses the source at deployment and use; no compiled unit crosses a producer boundary

1.3 Engineering readiness

1.3.1 Reproducibility

  • ✅ A procedure is deployed source: the same HDI artifact on the same server version and data reproduces the same result, and nothing is compiled ahead of the call outside the deployment
  • ❌ No toolchain pin exists in the artifact: the repository names no server revision — the executing release is a deployment fact the HDI container records elsewhere (Y14)

1.3.2 Supply chain

  • ❌ No signed provenance for published procedures or add-ons: deployment artifacts move through SAP’s channels under commercial terms, with no signature-checked public channel (Y3)
  • ❌ No advisory feed names the language surface: security fixes land in SAP notes and support packages, with no public CVE-mapped advisory database for the engine’s dependencies (Y16)

1.3.3 Observability

  • ❌ No tracing standard is part of the language: PlanViz, the SQL analyzer, and the trace configuration are server features, and the procedure text carries no trace hook (Y5)
  • ❌ No structured logging in the language: messages leave through SIGNAL and the server log, and no logging construct exists in SQLScript (Y6)

1.3.4 Feedback

  • ✅ The vendor’s IDE completes the code: SAP Business Application Studio publishes SQLScript tooling with code completion and the SQL analyzer beside it (Y8)
  • ❌ No procedure debugger ships in the standard toolchain: diagnosis goes through the SQL analyzer, PlanViz, and handler instrumentation (Y13)

1.3.5 Interop

  • ❌ No portable target: the body compiles in one vendor’s engine, and nothing in the language runs without a HANA server (Y10)

1.3.6 Governance

  • ❌ Governance is SAP: the release calendar, the roadmap, and the language’s direction are one company’s, and no independent body can change them (Y11)
  • ❌ No public specification exists: the SQLScript Reference documents the implemented behavior of one product line, and no independent implementation follows from it (Y12)
  • ❌ Correctness is what HANA does: no conformance suite exists for SQLScript, and the one implementation is the oracle (Y17)
  • ❌ The parser is closed: the grammar lives as prose in the SQLScript Reference and the parser inside the closed engine, so analysis tooling reads the manual and guesses (Y19)

1.4 Profile

Unscored, and kept separate from every score on purpose. The profile records what a mechanism price cannot express: what a running program costs, how well a coding model and an agent work in the language, and whether a safety-critical path exists.

1.4.1 Energy and cost

What this axis asks: what does a running program cost in energy and time?

  • ⚠️ Energy is the HANA process’s: column store, delta merges, and the application’s license bill pay, and the reader’s levers are set-oriented body design the reference argues for.

1.4.2 AI and agent readiness

What this axis asks: how well does a coding model and an agent work in this language?

  • ⚠️ Generated procedures appear in SAP migration and extension work, and the traps are the layer the reference warns about: imperative bodies, handler scope, and dynamic SQL that no generated snippet prices.

1.4.3 Safety certification

What this axis asks: is there a certified or standards-qualified path to a safety-critical system?

  • ⚠️ No certified path; the engine’s transaction and recovery guarantees are SAP’s, stated in its own documentation and support terms.

1.5 Scoring detail

1.5.1 Core coupling Dimensions

Dimension Mechanism Description Imposed by Present Weight
Type T1 dynamic no static check language — 0
T2 weak static language — 0
T3 dynamic/duck dispatch language — 0
T4 no sum types language — 0
T5 no generics language — 0
T6 no namespaces language — 0
T7 type erasure/reflection language — 0
T8 operator overloading language — 0
T9 inheritance required for polymorphism language — 0
T10 no null-safety language ✅ −8
T11 no module boundary language — 0
T12 no effect tracking language ✅ −8
T13 async/sync colouring language — 0
T14 unchecked foreign boundary language ✅ −4
T15 chars are encoding units language — 0
Type cost −5.7 (−20)
Construction C1 global mutable state by default language — 0
C2 no immutability by default language — 0
C3 constructors coupled to allocation language — 0
C4 no constructor/validation language — 0
C5 unpinned collection order language — 0
C6 aliasing by default language — 0
C7 undeclared control transfer language — 0
C8 no source-visible init order language — 0
Construction cost 0
Memory M1 manual deallocation runtime — 0
M2 GC non-deterministic pauses runtime — 0
M3 no RAII language — 0
M4 no ownership model language — 0
M5 uninitialized reads language — 0
M6 unchecked reinterpretation language — 0
Er6 uncatchable runtime fault language — 0
M7 reference cycles leak runtime — 0
Memory cost 0
Error Er1 no structured path language — 0
Er2 unchecked exceptions only language — 0
Er3 errors ignored/non-exhaustive language ✅ −4
Er4 no composable result type language ✅ −4
Er5 no isolation unit for a fault runtime — 0
Error cost −2.3 (−8)
Concurrency K1 GIL/no parallel runtime — 0
K2 shared mutable state default language ✅ −8
K3 manual sync no race detection runtime — 0
K4 no structured concurrency language — 0
K5 no primitives language — 0
K6 thread-per-task cost runtime — 0
Concurrency cost −2.3 (−8)
Platform P1 cannot function outside one vendor/domain context ✅ −15
P2 single-vendor but other uses context — 0
P3 legacy/discontinued platform context — 0
P4 poor domain fit context ✅ −8
Platform cost −6.6 (−23)

Core coupling score: 83.1/100 — 59 of the 350 inventory points are present, so the axis cost is 100 × 59 ÷ 350 = 16.9 and the score is 100 − 16.9. Each dimension’s cost above is its share of the same denominator, and the raw weight sum follows in parentheses.

1.5.2 Ecosystem coupling Dimensions

Dimension Mechanism Description Imposed by Present Weight
Performance R1 interpreted no AOT/JIT runtime — 0
R2 GC pauses runtime — 0
R3 JIT warmup runtime — 0
Performance cost 0
Ecosystem Ec1 no package manager context — 0
Ec2 fragmented tooling context — 0
Ec3 small/niche/discontinued context — 0
Ec4 proprietary context ✅ −8
Ec5 platform-locked tooling context — 0
Ec6 monoculture context — 0
Ec7 legacy burden context — 0
Ec8 unpromised binary boundary context — 0
Ec9 unpromised data boundary context — 0
Ecosystem cost −3.1 (−8)
Evolution V1 breaking changes language — 0
V2 frozen context — 0
V3 discontinued context — 0
V4 glacial standards context — 0
V5 silent default drift runtime — 0
V7 build-variant state space context — 0
Evolution cost 0
Domain D1 domain/vendor lock-in context ✅ −15
D3 framework forces architecture context — 0
Domain cost −5.9 (−15)
Learning L1 steep context — 0
L2 large surface/multi-paradigm context ✅ −4
L3 sparse docs context — 0
Learning cost −1.6 (−4)
Syntax S1 verbose language — 0
S2 inconsistent language — 0
S3 punctuation-heavy language — 0
Syntax cost 0
Testing G1 weak tooling context ✅ −8
G2 poor debugging context — 0
G3 runtime-only errors context — 0
G4 no published monotonic clock runtime ✅ −4
Testing cost −4.7 (−12)
Security Q1 memory-unsafe language — 0
Q2 dynamic/weak typing risk language — 0
Q3 known vulnerability/injection context ✅ −8
Q4 silent integer overflow language — 0
Security cost −3.1 (−8)

Ecosystem coupling score: 81.6/100 — 47 of the 256 inventory points are present, so the axis cost is 100 × 47 ÷ 256 = 18.4 and the score is 100 − 18.4. Each dimension’s cost above is its share of the same denominator, and the raw weight sum follows in parentheses.

1.5.3 Engineering readiness Dimensions

Dimension Mechanism Description Imposed by Present Weight
Reproducibility Y1 build not reproducible context — 0
Y2 dependencies not pinned context — 0
Y14 no toolchain version pin context ✅ −8
Y18 no machine-read project contract context — 0
Reproducibility cost −4.7 (−8)
Supply chain Y3 no signed provenance context ✅ −15
Y4 registry without namespacing context — 0
Y16 no advisory feed context ✅ −8
Supply chain cost −13.5 (−23)
Observability Y5 no stable tracing standard context ✅ −8
Y6 no structured logging context ✅ −4
Y15 no post-mortem diagnostics runtime — 0
Observability cost −7.0 (−12)
Feedback Y7 slow build context — 0
Y8 no fast in-editor analysis context — 0
Y13 no bundled debugger context ✅ −8
Feedback cost −4.7 (−8)
Interop Y9 no foreign-function interface language — 0
Y10 no portable target context ✅ −4
Interop cost −2.3 (−4)
Governance Y11 single-vendor governance context ✅ −15
Y12 closed specification context ✅ −15
Y17 no conformance mechanism context ✅ −8
Y19 no published parser context ✅ −8
Governance cost −26.9 (−46)

Engineering readiness score: 40.9/100 — 101 of the 171 inventory points are present, so the axis cost is 100 × 101 ÷ 171 = 59.1 and the score is 100 − 59.1. Each dimension’s cost above is its share of the same denominator, and the raw weight sum follows in parentheses.

Verdict: SQLScript is SAP HANA’s collection of SQL extensions — table types without tables, side-effect-free functions, and imperative procedure bodies — deployed through HDI into the engine’s containers. Its costs are the platform’s own: NULL in every domain, failures that travel only by exception, session-wide state, a proprietary stack end to end, and a reference that documents row-wise constructs as the thing the optimizer exists to avoid. Main strengths: a stated design goal of pushdown and parallelism, table variables the engine treats as sets, in-database R and Python for analytics, vendor IDE tooling with the SQL analyzer, and one-volume reference documentation. Main weaknesses: no debugger or user-procedure test harness, no structured logging or tracing in the language, string-built dynamic SQL, single-vendor governance with no specification or conformance suite, and logic whose reproducibility rides a commercial engine revision the artifact does not name.


The formal development. The definitions, theorems, and proofs behind this page are published in:

All published papers

References

[1]
Y. Loth, “On the nature of coupling: All coupling as shared resource access.” Zenodo, Aug. 2026. doi: 10.5281/zenodo.21925121.
[2]
Y. Loth, “Coupling as a consequence of cohesion: Decomposition, the coupling floor, and domain-imposed coupling.” Zenodo, Aug. 2026. doi: 10.5281/zenodo.21925201.
[3]
Y. Loth, “On the nature of cohesion: Cohesion as correctness relative to a partitioning rule.” Zenodo, Jul. 2026. doi: 10.5281/zenodo.20492912.
[4]
SAP SE, “SAP HANA SQLScript reference for SAP HANA platform 2.0 SPS 08.” https://help.sap.com/doc/6254b3bb439c4f409a979dc407b49c9b/2.0.08/en-US/SAP_HANA_SQL_Script_Reference_en.pdf, 2024.