Est. 1984 Intermediate

SQR

A procedural report-writing language that embeds SQL directly in program logic, long used as the batch-reporting workhorse of PeopleSoft and other enterprise systems

Created by Israel Stern

Paradigm Procedural; report generation with embedded SQL
Typing Dynamic; a variable's type is determined by its leading sigil ($ string/date, # numeric, & database column, % list)
First Appeared Mid-1980s (around 1984-1985)
Latest Version Distributed as Oracle Hyperion SQR Production Reporting and within Oracle PeopleTools; documentation was still maintained into the late 2010s

SQR — short for Structured Query Reporter — is a procedural programming language built for one job above all others: turning the contents of a relational database into formatted reports. Where a general-purpose language treats database access as a library call bolted onto the side, SQR makes SQL a first-class part of the program. A SELECT statement is a control structure in its own right: the body between BEGIN-SELECT and END-SELECT runs once for every row the query returns, with the selected columns automatically available as variables. That fusion of query and report logic made SQR a natural fit for the enterprise batch-reporting work it is best known for, and it became a defining tool of the PeopleSoft platform.

SQR is not a database and not a general application language. It sits in the same family as report writers and fourth-generation languages of the 1980s: tools designed so that a developer could describe what a report should contain and look like with far less code than a COBOL or C program would require. Decades later, SQR programs still run inside PeopleSoft and Oracle Hyperion deployments, quietly producing the payroll registers, financial statements, and administrative reports that large organizations depend on.

History & Origins

SQR was written by Israel Stern in Cleveland, Ohio, in the mid-1980s — most accounts place its origin around 1984–1985. (The exact first-release year is not precisely documented, so this date should be treated as approximate.) In its earliest form SQR was distributed as an add-on to Gupta’s SQLBase, which at the time was one of the few relational databases that ran on IBM PC-class (x86) hardware. Pairing a capable report writer with an affordable PC database gave SQR an early foothold.

Stern incorporated SQ Software in Cleveland (around 1988) to develop and sell the product commercially. From there SQR’s ownership changed hands repeatedly, tracing a path through much of the enterprise-software consolidation of the 1990s and 2000s:

  • The marketing partner D & N Systems, renamed SQL Solutions, was absorbed by Sybase in the early 1990s.
  • MITI (Managed Information Technologies, Inc.) acquired full rights to SQR in the mid-1990s and, in 1997, renamed itself SQRiBE Technologies.
  • Brio Technology bought SQRiBE in August 1999 and later became Brio Software.
  • Around 2000, Brio licensed the SQR source code to PeopleSoft, which bundled it into PeopleTools — the decision that tied SQR’s fortunes to one of the most widely deployed enterprise-application suites in the world.
  • Hyperion Solutions acquired Brio in 2003; Oracle acquired PeopleSoft in 2004 and Hyperion in 2007, leaving Oracle as the steward of both surviving lineages of SQR.

Design Philosophy

SQR’s central idea is that reporting and querying belong together. Rather than writing a loop that fetches rows and then, separately, formatting logic that prints them, an SQR programmer writes a query whose result rows are the loop. Everything a report needs — page headers and footers, running totals, column layout, page breaks — is expressed in a compact set of commands aimed squarely at document production.

A few principles run through the language:

  • SQL is native, not an afterthought. Queries are written inline and their columns flow directly into the surrounding report code.
  • Structure by section. A program is organized into named sections (setup, headings, footings, procedures) delimited by BEGIN-/END- command pairs, giving reports a predictable skeleton.
  • Precise output control. Commands position text at exact row-and-column coordinates on a page, which suited the fixed-format, print-oriented reports of the era.
  • Portability across databases. SQR aimed to run the same report logic against different back-end databases, insulating report code from the specific SQL dialect underneath.

Program Structure

An SQR program is a plain text file divided into sections marked with BEGIN-section/END-section commands. The most important are:

  • SETUP — describes overall characteristics of the report (page size, fonts, declarations).
  • HEADING / FOOTING — define what prints at the top and bottom of every page.
  • PROGRAM — the required entry point (BEGIN-PROGRAMEND-PROGRAM); there is exactly one, and it controls the order of processing.
  • PROCEDURE — reusable subroutines (BEGIN-PROCEDUREEND-PROCEDURE) that provide modularity; procedures call other procedures.
  • SQL / SELECT — embedded database access.

The canonical minimal program simply prints a string at a fixed position on the page:

begin-program
  print 'Hello, World.' (1,1)
end-program

The real power appears when a query drives the output. In the pattern below, the block between begin-select and end-select executes once per returned row, and each selected column is referenced with an ampersand-prefixed name:

begin-program
  do main
end-program

begin-procedure main
  begin-select
name
salary
    print &name    (+1, 1)
    print &salary  (0, 40)
  from   employees
  order by name
  end-select
end-procedure

Type System and Variables

SQR is loosely, dynamically typed, and its most distinctive syntactic feature is that a variable’s type is encoded in its name. The leading character (a “sigil”) tells both the reader and the interpreter what kind of value a variable holds:

PrefixKindNotes
$String (or date)Any undeclared name starting with $ is a string variable
#NumericDefaults to floating point unless declared otherwise
&Database columnNames a column or expression returned by a SELECT
%ListAn ordered collection of variables, created with LET

Assignment and computation are done with commands such as LET, MOVE, and ADD, and the language provides three scalar-oriented data notions (numeric, string, and date values) alongside array structures. Control flow is handled by a small set of constructs: IF/ELSE/END-IF, WHILE/END-WHILE, EVALUATE (a multi-way branch), and the row-iterating BEGIN-SELECT loop itself. Sequential file I/O rounds out the language for reading and writing flat files.

Evolution

SQR grew from a PC-database companion in the 1980s into an enterprise reporting engine. Its capabilities expanded over the years to include richer formatting, chart and graph generation, multiple output formats, and integration hooks for the systems that embedded it. The most consequential change was organizational rather than syntactic: once SQR became part of PeopleTools, its evolution was driven by the needs of PeopleSoft developers, and its documentation and versioning tracked PeopleTools releases (the SQR Language Reference continued to be maintained and republished by Oracle into the late 2010s). In parallel, the Hyperion lineage carried SQR forward as Oracle Hyperion SQR Production Reporting for business-intelligence use.

Current Relevance

SQR is a legacy technology, but a remarkably durable one. It is no longer a language anyone would choose for a brand-new project, and it does not appear in popularity indexes alongside general-purpose languages. Yet it remains in active production use wherever PeopleSoft does — and PeopleSoft still underpins HR, payroll, financials, and student systems at many large corporations, government agencies, and universities. As long as those SQR programs keep producing correct payroll runs and regulatory reports, organizations have little incentive to rewrite them, and demand for SQR maintenance skills persists in the PeopleSoft ecosystem.

Why It Matters

SQR is a clear example of the fourth-generation, domain-specific tools that shaped enterprise computing before general-purpose languages and modern BI platforms took over reporting. Its defining insight — that a query result set can serve directly as the driving loop of a report — is an elegant one, and it let developers express in a few dozen lines what would have taken hundreds in a general-purpose language of the time. SQR’s long survival inside PeopleSoft also illustrates a recurring truth of software history: a language embedded deeply enough into critical business processes can outlive its creators, its independence, and even the companies that once owned it, running on quietly for decades after the industry’s attention has moved elsewhere.

Sources

Timeline

1984
Israel Stern writes SQR in Cleveland, Ohio, in the mid-1980s (sources place it around 1984-1985) as a reporting tool; in the early days it was distributed as an add-on to Gupta's SQLBase, then one of the few relational databases running on IBM PCs
1988
Stern incorporates SQ Software in Cleveland, Ohio, to develop and market SQR commercially; the product's name is an abbreviation of Structured Query Reporter, signalling its close relationship to SQL
1990
The marketing partner D & N Systems, renamed SQL Solutions, is acquired by Sybase Inc. in the early 1990s, folding SQR into Sybase's tooling
1995
MITI (Managed Information Technologies, Inc.) acquires the full rights to SQR in the mid-1990s, taking over its development
1997
MITI renames itself SQRiBE Technologies, reflecting SQR as its flagship product
1999
Brio Technology acquires SQRiBE Technologies in August 1999; Brio later renames itself Brio Software
2000
Brio licenses the SQR source code to PeopleSoft, Inc. around 2000, and SQR becomes a core batch-reporting tool bundled inside PeopleTools, the PeopleSoft development platform
2003
Hyperion Solutions Corporation acquires Brio Software in October 2003, bringing SQR into the Hyperion product family
2004
Oracle Corporation acquires PeopleSoft in December 2004, taking ownership of the PeopleTools edition of SQR
2007
Oracle acquires Hyperion Solutions in 2007; SQR continues as Oracle Hyperion SQR Production Reporting and as the SQR bundled with Oracle PeopleTools

Notable Uses & Legacy

PeopleSoft applications

SQR is one of the primary tools for writing batch reports and data-processing programs in PeopleSoft HCM, Financials, and Campus Solutions, where it reads and writes application tables and produces printed and file-based output

Higher education

Universities running PeopleSoft Campus Solutions have historically relied on SQR programs for student, financial-aid, and administrative reporting and for bulk data loads

Public sector and payroll

Government agencies and large employers use SQR within PeopleSoft HCM to generate payroll registers, tax reports, and regulatory filings driven directly by SQL against the HR database

Oracle Hyperion production reporting

As Oracle Hyperion SQR Production Reporting, the engine is used for high-volume, formatted operational reports in business-intelligence deployments

Enterprise batch reporting

Across finance, insurance, and other data-heavy industries, SQR has been used for scheduled batch jobs that query relational databases and emit invoices, statements, and management reports

Language Influence

Influenced By

Running Today

Run examples using the official Docker image:

docker pull
Last updated: