Case Study ยท AI ยท Oracle ยท OCI

Transport Company AI Data Explorer

Building a Natural Language to SQL platform on Oracle APEX and OCI GenAI โ€” so non-technical operations staff could query live transport data just by typing a question.

RoleArchitect & Lead Developer
PlatformOracle Cloud (OCI)
DomainTransport Operations
TypeAI / GenAI POC โ†’ Production

Operations data locked behind SQL โ€” invisible to the people who need it most

The transport company's operations team managed hundreds of vehicles, routes, drivers, and consignment records inside an Oracle Autonomous Database. Every meaningful business question required raising a ticket to IT for a custom SQL report โ€” creating a 2โ€“3 day lag between question and answer.

Business Goal: Allow operations managers to type questions in plain English and receive accurate, live query results from the Oracle ADB โ€” with zero SQL knowledge required.

Two-layer AI pipeline on Oracle infrastructure

1
Oracle APEX Chat InterfaceOperations staff enter plain-English questions via a lightweight APEX page embedded directly in the existing ops portal.
2
PL/SQL Sanitisation WrapperA custom PL/SQL function applies REGEXP_REPLACE to strip dangerous tokens (DROP, DELETE, TRUNCATE, semicolons) and enforces SELECT-only queries before passing to the AI layer.
3
DBMS_CLOUD_AI with OpenAI GPT-4o-miniOracle's native AI integration converts sanitised natural language into SQL using full schema context injected as system prompt.
4
Live ADB Query & Result RenderingGenerated SQL runs against the Oracle Autonomous Database. Results surface in APEX as a formatted data grid with plain-English explanation.
5
OCI GenAI as FallbackFor latency-sensitive queries, OCI GenAI (Cohere Command) was configured as a secondary profile, keeping data entirely within Oracle's cloud boundary.

What nearly broke this project

Measurable impact

87%
First-attempt query accuracy
<10s
Average query response time
2โ€“3d
IT report wait time eliminated
0
SQL knowledge required

Result: Approved for Phase 2 expansion โ€” adding write-back capabilities and integration with the vehicle tracking API.


Back to all projects