Stored procedure
A program stored in DB2 and run with a single SQL CALL, so an application can do several database steps in one request.
Also written SQL CALL, native SQL procedure, external stored procedure, SQL procedure, WLM application environment
A stored procedure is a program that DB2 keeps and runs on request. An application, which may be on another computer, issues one SQL CALL statement with some values, and the procedure does the work inside DB2: several queries and updates, checks and calculations. It then returns the results.
This saves time and keeps business rules in one place. Instead of an application sending ten separate SQL statements over the network, it sends one call. And every application that needs the same logic uses the same procedure.
DB2 for z/OS has two main kinds. Native SQL procedures are written in SQL's own procedural language and run inside DB2 itself. External stored procedures are written in a language such as COBOL and run in separate address spaces managed by WLM, set up as WLM application environments.
When a stored procedure is called from outside the mainframe, much of its work can run on zIIP processors, which is one reason sites use them. You will see them in projects that connect web and mobile applications to DB2 data.
Where can I learn this hands-on?
Right here, at ZedBank. You take a junior job at a simulated bank and learn each part of the work by doing it, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- DB2 for z/OSIBM's relational database on the mainframe, where a great deal of the world's banking and insurance data is stored.
- SQLThe language used to query and change relational data. The same SQL used everywhere else, running against mainframe tables.
- WLMWorkload Manager: the part of z/OS that decides which work gets the processor, memory and disk access first, based on goals the site sets.
- Embedded SQLSQL statements written directly inside a COBOL program, marked off so they can be prepared before compiling.
- COBOLThe programming language most business logic on the mainframe is written in. Verbose by design, and still running the world's payments.
- Specialty engineA mainframe processor set aside for one kind of work, such as Linux or certain z/OS workloads, and usually priced lower than a general processor.