AboutBlogContact
Software DevelopmentMarch 12, 1998 2 min read 17

PowerBuilder: DataWindow Internals (1998)

AunimedaAunimeda
📋 Table of Contents

PowerBuilder: DataWindow Internals

If you're building client-server applications in the late 90s, you're either using PowerBuilder or you're doing too much work. Sybase's DataWindow technology is still the gold standard for data-driven UIs.

What is a DataWindow?

A DataWindow isn't just a grid; it's a declarative definition of a database query and its visual representation, all bundled into one object.

The Buffer System

The secret to the DataWindow's power is its four internal buffers:

  1. Primary: Data currently displayed to the user.
  2. Filter: Data that matched the query but is currently filtered out.
  3. Delete: Data the user has deleted but hasn't been committed to the DB yet.
  4. Original: The values as they were when originally fetched (used for optimistic locking).
// Updating a record is just one line
IF dw_1.Update() = 1 THEN
    COMMIT USING SQLCA;
ELSE
    ROLLBACK USING SQLCA;
END IF

Direct Syntax Access

You can modify the DataWindow's behavior at runtime by manipulating its internal syntax string.

string ls_syntax
ls_syntax = dw_1.Describe("DataWindow.Syntax")
// You can modify ls_syntax and call dw_1.Create()

The DataWindow handles all the messy SQL generation (INSERT, UPDATE, DELETE) for you. It even manages the concurrency checks by comparing the Original buffer with the current DB state. If you're manually writing UPDATE statements in your UI code, you're doing it wrong.

Read Also

Delphi 5: Building Custom VCL Components (1999)aunimeda
Software Development

Delphi 5: Building Custom VCL Components (1999)

Visual Component Library is the crown jewel of Delphi. Let's build a custom component that goes beyond the standard palette.

Visual Basic 1.0: Drag-and-Drop for the Massesaunimeda
Software Development

Visual Basic 1.0: Drag-and-Drop for the Masses

Windows development used to be a nightmare of C code and message loops. Visual Basic 1.0 changes everything with a radical new idea: drawing your UI.

PostgreSQL: GIN and GiST Indices (2006)aunimeda
Databases

PostgreSQL: GIN and GiST Indices (2006)

B-Trees are fine for integers, but what about full-text search or geometric data? It's time to learn the power of GIN and GiST.

Need IT development for your business?

We build websites, mobile apps and AI solutions. Free consultation.

Get Consultation All articles