Published at 11/5/2024

Sample Database Create Procedure for IBM i

Normally, as an admin or programmer, one wants to test out an idea, right? But that idea requires some "data," you know, the new "oil".

Well, fret no more. On IBM i, you have this wonderful stored procedure that comes with ALL installations (with appropriate permissions) that creates a schema with your choice of name and sample data.

To run it, all you need to do is fire up the SQL prompt of your choice and enter:

CALL QSYS.CREATE_SQL_SAMPLE('SAMPLE');

where:

  • 'SAMPLE' is the Schema Name.

Do note the following:

  • It creates and starts its own journals called QSQJRN inside that library.
  • It contains its own system catalog tables
  • It a good structure for people who want to learn SQL Views and Constraints

Some of the goodies you might expect after it created the schema: SampleOutput-SAMPLE Database Schema.png

So give it a spin and elevate your coding/admin tasks to a new level on IBM i.

Additional details can be found here: SAMPLE Tables

Share on social media

Facebook share buttonReddit share buttonThreads share button