APEX, ORDS & the Oracle Database
I’m Jon Dixon, an Oracle APEX developer and consultant at Cloud Nueva. I write about APEX, ORDS, the Oracle Database, and how AI is changing the way we build software. This blog is where I share practical examples, lessons learned, and ideas from my work.
Markdown supported · ⌘↵ to post
The distinction between an exploratory calculation and a shared metric is useful. I’d also make the aggregation rule explicit in tests: a weighted margin should be computed from summed profit and summed revenue, while zero or missing denominators need a deliberate policy. That catches cases where each row looks right but the grouped result answers a different question.
The 30% versus 38.18% example is a useful reminder that a correct row formula can still produce a misleading report total. I’d include unequal-sized sales, returns and zero-revenue rows in the test fixtures before treating the generated margin as a shared business metric.
Bringing natural language formula parsing directly into enterprise frameworks saves tremendous time for analysts. The key balance is always transparent SQL translation so developers can still inspect the generated execution plan.
The divide-by-zero test is the part that stuck with me. The first prompt produced a correct-looking margin, then a single zero-revenue row took the whole report down with ORA-01476, which is exactly the kind of failure that only shows up in real data. Putting the guard in Report Context instead of relying on every user to phrase the prompt correctly feels like the right call, since the CASE WHEN F=0 THEN NULL version also makes the intent explicit: a zero-revenue margin is undefined, not zero. I also liked the discipline in the conclusion: use the natural-language calculation to explore, then lock the agreed definition into SQL or a view once the team has settled what margin means. Did the Luna model ever suggest a different fallback, such as returning 0 instead of NULL, or was NULL its consistent choice across your runs?
Connor McDonald
Things that sh*t me about hashnode... I craft my comment to this blog post, press "Post" and it says "Hey, please login". No probs....
What it didnt say was "Hey, please login, and when you do so, we're throwing away anything you've typed as a comment, and by the way, pressing Back won't save you, because we're gonna refresh the page as well... so yeah, sucker, you can just type all that again"
sigh....