Quick answer: SAP HANA Cloud QRC 3/2026 introduced AI_CORE_REQUEST, a SQL function that can call a foundation-model deployment registered in SAP AI Core. It accepts a model, a messages array and optional inference parameters, then returns a structured response. This enables classification, summarization and data enrichment close to the database—but it also requires careful security, cost and data-governance controls.
What is AI_CORE_REQUEST?
AI_CORE_REQUEST lets SQL invoke a foundation model managed through SAP AI Core. Traditionally, an application service had to read database data, call an external model API, parse the response and write the result back. The new function can reduce that application-layer plumbing for selected use cases.
The request contains three important parts:
- Model/deployment: the approved AI Core foundation model to call.
- Messages: system and user instructions plus the business text.
- Inference parameters: options such as output length or randomness, when the selected model supports them.
Architecture in one minute
- A SQL statement selects approved business text or metadata.
- HANA Cloud sends a governed request to the configured SAP AI Core model.
- The model produces a structured response.
- SQL extracts the required value and returns or stores it.
- Application and data-governance rules decide whether the result may be used automatically or needs review.
Conceptual SQL pattern
-- Conceptual pattern: verify the exact QRC 3/2026 signature
SELECT AI_CORE_REQUEST(
<approved_model>,
<messages_json_array>,
<optional_inference_parameters>
) AS model_response
FROM DUMMY;
This deliberately uses placeholders because deployment identifiers, model parameters and the exact supported syntax depend on your SAP HANA Cloud and SAP AI Core configuration. Never paste service credentials into SQL source or a blog example.
Practical use case 1: support-ticket classification
Suppose a table contains a short ticket description. The model can return a controlled category such as BILLING, DELIVERY, TECHNICAL or OTHER. A strong prompt should restrict the output:
System: Classify enterprise support tickets.
Return valid JSON only.
Allowed categories: BILLING, DELIVERY, TECHNICAL, OTHER.
Do not include personal data in the explanation.
User: <sanitized ticket text>
Validate the returned category with a SQL allowlist before storing it. A model response is untrusted input even when it comes from an approved deployment.
Practical use case 2: safe summarization
For long internal notes, request a short operational summary with a fixed maximum length and no invented actions. Keep source identifiers separate from the text passed to the model so the prompt contains only what is necessary.
- Remove names, email addresses and account numbers unless explicitly required and permitted.
- Limit the number and size of rows processed in one job.
- Store model name, prompt version and execution time for traceability.
- Show the original text to a reviewer when the summary drives a business decision.
Practical use case 3: AI-derived columns
SAP’s September 2026 HANA Cloud update notes that model inference can be connected to a generated-column scenario so inserts or updates can refresh AI-derived attributes. This is convenient, but it can also create hidden cost and latency for write-heavy tables.
Before choosing this pattern, answer these questions:
- How many inserts and updates happen per hour?
- Can the transaction tolerate model latency or temporary AI Core unavailability?
- Should a retry produce a new result or reuse the original one?
- How will you reprocess rows after changing the model or prompt?
- What happens when the response is invalid JSON?
For high-volume workloads, a controlled batch or queue may be safer than automatic inference on every write.
AI_CORE_REQUEST vs AI_TEXT_COMPLETION
| Area | AI_CORE_REQUEST | AI_TEXT_COMPLETION |
|---|---|---|
| Request style | Messages array plus optional inference parameters | Prompt-oriented text completion |
| Model access | Foundation model registered in SAP AI Core | LLM service through GenAI hub and a configured remote source |
| Best fit | Chat-style requests and structured model responses | Straightforward prompt-to-text completion |
| Release check | Confirm QRC 3/2026 support and exact signature | Confirm supported model, remote source and privileges |
Security checklist
- Least privilege: grant execution only to the application role that needs it.
- Approved models: allowlist deployments and model versions.
- Data minimization: send only the columns and rows necessary for the task.
- Prompt-injection defense: treat database text and model output as untrusted.
- Output validation: enforce JSON schemas, allowed values and maximum lengths.
- Secrets: keep certificates and service credentials in supported secure configuration, never table columns or source code.
- Auditability: log prompt version, model, timestamp, status and usage metadata without exposing sensitive content.
- Human review: require approval for financial, HR, legal or customer-impacting decisions.
Cost and performance controls
- Filter and deduplicate rows before calling the model.
- Set maximum input and output sizes.
- Cache results when the same stable input appears repeatedly.
- Use a deterministic prompt and low-randomness settings for classification.
- Measure p50, p95 and failure latency separately from normal SQL time.
- Track model usage by business process and environment.
- Add retry limits and a dead-letter path; do not create infinite SQL retries.
Production-ready processing pattern
1. Select eligible rows with a fixed batch size.
2. Sanitize and minimize the input.
3. Call the approved model.
4. Parse and validate the structured response.
5. Save result + model + prompt version + status.
6. Route invalid or low-confidence output to review.
7. Monitor latency, failure rate and cost.
Common mistakes
- Calling a model for every row without estimating volume and cost.
- Sending complete business documents when only one paragraph is needed.
- Trusting JSON simply because it parses successfully.
- Mixing production credentials into SQL scripts.
- Ignoring prompt and model versioning.
- Using AI output as a final business decision without a confidence or review policy.
- Assuming all HANA Cloud revisions support the same function signature.
Interview questions
- What problem does
AI_CORE_REQUESTsolve? - When would an application-layer API call still be preferable?
- How do you protect sensitive table data before model inference?
- Why must a structured model response still be validated?
- What are the risks of binding inference to every insert or update?
- How would you measure and control model cost from SQL?
Frequently asked questions
Can AI_CORE_REQUEST call any public model API?
It is designed for foundation models registered and governed through SAP AI Core. Use only models and deployments supported by your current environment.
Does it remove the need for SAP AI Core?
No. SAP AI Core still provides the managed model deployment and related lifecycle, security and governance capabilities.
Should I run it inside an online transaction?
Only after testing latency, failure handling and cost. A queue or batch is often safer for non-interactive enrichment.
Is AI-generated data deterministic?
Not necessarily. Results can vary by model, parameters and model version. Store provenance and design a review or reprocessing strategy.
Continue learning
Official SAP references
- What’s New in SAP HANA Cloud – September 2026
- SAP Help: Create a Generative AI Hub Remote Source
- SAP Help: AI_TEXT_COMPLETION
Last reviewed: November 2026. Always check current SAP Help for your HANA Cloud revision.

0 Comments