DB2 10.5 for Linux, UNIX, and Windows

Perl Samples

UNIX directory: sqllib/samples/perl.

Windows directory: sqllib\samples\perl.

Table 1. Perl sample program files
Type of sample Sample program name Program description
Database Level - Samples that deal with database objects in DB2®. dbauth.pl How to grant/display/revoke authorities at the database level.
dbuse.pl How to use a database.
Table Level - Samples that deal with table objects in DB2. tbconstr.pl How to create, use, and drop constraints.
tbinfo.pl How to get information about a table at the table level.
tbpriv.pl How to grant, display and revoke privileges on a table.
tbsel.pl How to select from each of: insert, update, delete.
tbselcreate.db2 How to create the tables for the tbsel program.
tbseldrop.db2 How to drop the tables for the tbsel program.
tbtrig.pl How to use a trigger on a table.
tbuse.pl How to perform basic database operations and connect to/disconnect from a database.
Data Type Level - Samples that deal with data types. dtlob.pl How to use the LOB data type.
Stored Procedures - Samples that demonstrate stored procedures. spclient.pl Client program containing ten functions to call stored procedures.
Workload management - Samples that deal with workload management. wlmhist.pl Generates historical data for activities that are captured for the event_activity and event_activitystmt logical data groups in the WLMHIST table.
wlmhistrep.pl Generates historical analysis reports based on user input and data from the WLMHIST table.
qpwlmmig.pl Generates a script that will help migrate a Query Patroller environment to a WLM environment. DB2 Query Patroller has been discontinued starting in the Version 10.1 release.
Other sample files DB2SampUtil.pm Defines common functions like command line argument checking. Also defines functions to prepare and execute an SQL statement, and to roll back if an error occurs.
DB2WlmHist.pm Defines common functions like prepare and execute SQL statements and roll back if an error occurs that will be used for the WLM Historical Generator and the WLM Historical Reports tools.