Oninit® SQLMorph — Informix 4GL to UDR
SQLMorph compiles an Informix® 4GL FUNCTION into a native C UDR that runs inside the
database engine. The function is then called from SQL, from SPL or from another converted function, and no 4GL
runtime is involved. The business rules that lived in the client move to the server, next to the data, and a call
that used to cost a round trip per query becomes part of the statement that needs it.
The 4GL backend converts the functions that hold logic — arithmetic,
string and date handling, records, arrays, cursors and FOREACH, calls between functions — and it
refuses, with a message naming the line, anything that needs a screen or a program around it.
Why not SPL
4GL and SPL disagree where a faithful conversion matters: NULL in expressions, blank-padded CHAR
comparison, DECIMAL precision, DATETIME and INTERVAL arithmetic, substrings,
USING masks, records — and arrays, which SPL does not have at all. The generated
C links a small runtime that implements the 4GL rules, so the converted function computes what the original
computed. Converted functions are registered as LANGUAGE C.
In this section
| Page | What it covers |
|---|---|
| Build and Install | The command line, the four files per function, deploying to an engine, versioning. |
| Statements and Types | What converts: types, control flow, built-ins, DATETIME and INTERVAL. |
| Records and Arrays | rec.*, record copy, ARRAY of one to three dimensions with checked subscripts. |
| Embedded SQL | Host variables, cursors, FOREACH, PREPARE, WHENEVER, status and sqlca. |
| Calling Other Functions | Fastpath calls, recursion, several return values, functions that return rows. |
| Run-time Behaviour | NULL rules, errors, yielding, depth limit, memory. |
| What Is Refused | Every diagnostic code and the reason for it. |
A worked introduction is in the article Converting Informix 4GL Functions into C UDRs That Run Inside the Engine.