Glossary

Db2 for i HTTP Functions

QSYS2 HTTP functions

Db2 for i HTTP functions are SQL functions in the QSYS2 schema that call a web service straight from a SQL statement on IBM i, which is how an RPG or SQL program can reach an AI model's REST endpoint without installing anything extra. IBM ships GET, POST, PUT, PATCH and DELETE, each in text, binary and verbose forms, and says they give the same capabilities as the older SYSTOOLS HTTP functions without the overhead of creating a JVM.

What it isSQL functions that call a web service from inside a SQL statement on IBM i
SchemaQSYS2, the same schema that holds most IBM i Services
OperationsGET, POST, PUT, PATCH and DELETE, each in text, binary and verbose forms
What it needs5770SS1 option 3 and option 34, plus a current database PTF group level

What are Db2 for i HTTP functions?

Think about ordering takeout by phone. You dial, read out your order, wait on the line, and write down what they say back. These functions are the phone. Your program dials a web address, hands over a request, and gets the reply back as text, all inside one SQL statement. SQL is Structured Query Language, the language Db2 for i already speaks. Nothing new has to be installed on the box to make the call.

IBM puts all of them in the QSYS2 schema. There are five operations, GET, POST, PUT, PATCH and DELETE, and each one comes in four shapes. The plain shape returns text. The BLOB shape returns raw bytes, and BLOB means binary large object. The two verbose shapes add the response headers the server sent back, formatted as JSON, which is JavaScript Object Notation. IBM describes the plain functions as scalar functions and the verbose ones as table functions that return a single row. Alongside them IBM ships six text helpers for URL and Base64 encoding and decoding.

How many of these functions IBM ships

HTTP request functions20 functions
Text encoding helpers6 functions

Counted from the function list on IBM's Db2 for i HTTP functions overview page for IBM i 7.5, read November 21, 2026. Five operations times four shapes each gives 20. The six helpers are BASE64_DECODE, BASE64_ENCODE, HTML_ENTITY_DECODE, HTML_ENTITY_ENCODE, URL_DECODE and URL_ENCODE.

What does the call look like?

Each function takes three things: the address, the request body, and an options string. IBM's reference page gives the shape as HTTP_POST(url, request-message, options), and says the options string must be formatted as a JSON object containing the options, including headers, for the request. IBM's own example reads VALUES QSYS2.HTTP_POST('https://www.example.com/users', 'ABC', '{"sslCertificateStoreFile":"/home/javaTrustStore/fromJava.KDB"}'). HTTP_POST hands back CLOB(2G) CCSID 1208 holding the response message, and HTTP_POST_BLOB hands back BLOB(2G). CLOB means character large object, 2G is the two gigabyte ceiling on the size, and CCSID 1208 is UTF-8 text.

The options string is where the request headers go, so that is where an Authorization header or a content type lands. IBM's support page records that a headers structure, which holds all header options inside one JSON object, arrived later than the functions themselves, at IBM i 7.5 SF99950 Level 3 and IBM i 7.4 SF99704 Level 23. Read that page for your own release before you write the options string one way or the other.

How does an IBM i program reach an AI model with them?

Four steps from a SQL statement to a model answer

  1. Build the request as JSON textAn AI model service wants its input as a JSON body. That is just text, so an RPG or SQL program on IBM i can build it like any other string.
  2. Call QSYS2.HTTP_POST with the address, the body and the optionsIBM's watsonx.ai API documentation shows inference endpoints such as POST /ml/v1/deployments/{id_or_name}/chat/completions, called over HTTPS with a bearer token in the Authorization header. The address and the body are the first two parameters of the function. The token header goes in the options JSON. API means application programming interface.
  3. Take the reply out of the functionHTTP_POST returns CLOB(2G) CCSID 1208 containing the response message. If you also want the status and the headers the server sent, call HTTP_POST_VERBOSE instead, which is a table function that returns one row carrying that header information as JSON.
  4. Read the answer out of the JSON with Db2 for iThe reply is still a block of JSON text, and Db2 for i already parses it. IBM documents JSON_VALUE as returning an SQL scalar value from a JSON text by using a path expression, and JSON_TABLE as returning a result table from the evaluation of path expressions. So the model's answer can land in a column like any other value.

Steps assembled from sources read November 21, 2026: IBM's Db2 for i HTTP functions overview page, IBM's HTTP_POST and HTTP_POST_BLOB reference page, the IBM Cloud API documentation for watsonx.ai, and the Db2 for i reference pages for JSON_VALUE and JSON_TABLE. The exact endpoint, body and token for any one model service come from that service's own documentation, not from the SQL function.

Why not the older SYSTOOLS HTTP functions?

What IBM says about the two sets

QuestionSYSTOOLS HTTP functionsQSYS2 HTTP functions
Schema they live inSYSTOOLSQSYS2
What they can doThe original setIBM: the same capabilities as the SYSTOOLS HTTP functions
Java virtual machineCreating one is the overhead IBM namesNot needed
OverheadHigher, per IBMIBM: lower overhead than the SYSTOOLS HTTP functions
Extra controls IBM namesNone named on these pagesHTTP authentication, proxy support, configurable redirection attempts, configurable SSL options

Read from IBM's Db2 for i HTTP functions overview page and IBM's support page New HTTP functions based in QSYS2 on November 21, 2026. IBM's wording is that the QSYS2 functions provide the same capabilities as the SYSTOOLS HTTP functions without the overhead of creating a JVM, where JVM means Java virtual machine. Table rows are not linked because this site's content blocks render as plain text.

What do you need installed, and what should you watch out for?

What IBM added, and the database PTF group level that carries it

What IBM addedDatabase PTF group levels IBM lists
HTTP_PATCH, HTTP_PATCH_VERBOSE, and a verboseResponseHeaderFormat option that sets how response header information is formattedIBM i 7.5 SF99950 Level 1, IBM i 7.4 SF99704 Level 20, IBM i 7.3 SF99703 Level 28
A headers structure that holds all header options inside one JSON objectIBM i 7.5 SF99950 Level 3, IBM i 7.4 SF99704 Level 23
BLOB based versions of the QSYS2 HTTP functionsIBM i 7.5 SF99950 Level 4, IBM i 7.4 SF99704 Level 25
URL_ENCODE and URL_DECODE extended to handle two gigabyte valuesIBM i 7.6 SF99960 Level 2, IBM i 7.5 SF99950 Level 11
URL_ENCODE support for RFC3986 encodingIBM i 7.6 SF99960 Level 3, IBM i 7.5 SF99950 Level 12
Header options for decompression, decompressPayload, and for loggingIBM i 7.6 SF99960 Level 4, IBM i 7.5 SF99950 Level 13

Read from IBM's support page New HTTP functions based in QSYS2 on November 21, 2026. A PTF is a program temporary fix, and these are the database PTF groups for each release. Table rows are not linked because this site's content blocks render as plain text.

  • Two licensed program options have to be on the box: 5770SS1 option 3, Extended Base Directory Support, and 5770SS1 option 34, Digital Certificate Manager.
  • Only http and https addresses work. IBM states that HTTP authentication is not allowed for http URLs, so any call that signs in needs https, and an https request uses TLS to create the secure channel.
  • The plain functions are scalar functions, so the call sits inside your SQL statement and the job waits for the reply.
  • Text versions return CLOB(2G) CCSID 1208 and binary versions return BLOB(2G), so two gigabytes is the ceiling on a reply.

Check your own release and database PTF group level before you design around one of these. IBM added the functions and their options in waves rather than all at once, so a box that is behind on fixes can have HTTP_POST and still be missing the headers structure or the BLOB versions. The table above is what IBM lists, and IBM keeps adding to that page.

Related Terms

Db2 for i

The relational database management system built into every IBM i operating system, tightly integrated with IBM i rather than a separately installed database product.

IBM i Services

IBM i Services are SQL views, table functions, procedures and functions that IBM ships inside the operating system, so you can read system information with a SELECT instead of coding to a system API. Most live in the QSYS2 schema, and they are how AI agents read an IBM i box: every tool in IBM's own IBM i MCP Server is a SQL statement against a service such as QSYS2.SYSTEM_STATUS or QSYS2.NETSTAT_INFO.

RPG

Report Program Generator, the primary business application programming language on IBM i and its AS/400 predecessors, still running the majority of production logic in most IBM i shops.

watsonx.ai

The studio component of watsonx for building, tuning, and deploying foundation models and generative AI applications, including retrieval-augmented generation (RAG) against enterprise data.

IBM i MCP Server

An open-source, IBM-published server implementing the Model Context Protocol (MCP), letting AI agents and LLMs query Db2 for i data and take defined actions on IBM i using natural language. In beta since October 2025.

Retrieval-Augmented Generation (RAG)

Retrieval-Augmented Generation hands a language model passages pulled from your own data, so it answers from your content. On IBM i, retrieval is the hard half.

IBM i

IBM's operating system for Power servers running traditional AS/400-lineage business applications, with Db2 for i built directly into the OS.