Download Latest Version tpc-c-ifmx.tar.gz (392.7 kB)
Email in envelope

Get an email when there's a new version of IIUG Software Repository

Home / SQL-Tools / pload
Name Modified Size InfoDownloads / Week
Parent folder
onpload.exp 2020-05-11
create_pload.sh 2020-05-11 8.1 kB
device.tmpl 2020-05-11 110 Bytes
formatitem.tmpl 2020-05-11 163 Bytes
formats.tmpl 2020-05-11 184 Bytes
hpexport.ksh 2020-05-11 5.2 kB
hpimport.ksh 2020-05-11 2.3 kB
mapitem.tmpl 2020-05-11 153 Bytes
maps.tmpl 2020-05-11 109 Bytes
query.tmpl 2020-05-11 52 Bytes
README 2020-05-11 3.7 kB
session.tmpl 2020-05-11 276 Bytes
Totals: 12 Items   20.4 kB 0
'create_pload.sh' is a shell script that creates load/unload jobs from the
command line. The job names created are the tabname + U(nload) and
tabname + L(oad). Eighteen character filenames are reduced by magic by one
character so the 'L' or 'U' can be added.

The unload files are in binary format. Read the notes in create_pload.sh to 
change this back to ASCII delimited format.

If the onpload database already contains the job, the old is deleted and the
new one added.

The script uses '.tmpl' template files that are transformed into '.unl' load
files. The load files are then loaded into the 'onpload' database.

INSTALLATION:
 Create a 'pload' directory in an appropriate place.
 Extract from the tar file.

If you want to start with a fresh 'onpload' database, then drop it before 
running create_pload.sh. It will create a new one.

Beware the 18 char limit on owner+tabname in pre 7.23.UC3 versions of HPL!!!


Comments from the script:

#!/bin/ksh
# Changed to /bin/ksh because sh is in different directories in various OSes.
#
##############################################################################
# create_pload.sh
#    Usage: create_pload.sh database table directory [ #files ]
#
# Creates an express load/unload job in the 'onpload' database for the table.
# Creates the 'onpload' database if it does not exist.
# Creates a device array of "#files" (1 default). The files are all in the
#  specified directory. If you desire to put the files in different places
#  (to get past the filesystem size limit) then create links to the file
#  in the specified directory before executing the load/unload jobs.
#
# Author: Gary Lively, Informix Software, Inc. - 10/03/97
#
# Modifications:
#    Please submit bug fixes, etc. to me at glively@informix.com.
#
#    GJL - 11/18/97  Added logic to support 18 character table names. The
#                    'name' column in various onpload tables is char(18)
#                    which prevents suffixing with the 'U' or 'L' for the
#                    unload/load jobname. Table names of 18 characters are
#                    reduced by either removing imbedded '_' characters or
#                    the last character is replaced with 'U' or 'L'. If this
#                    will not yield a unique name then a error is returned.
#                    The name used is echoed to stdout.
#    GJL - 03/24/98  Corrected problem with SK_QUERY value.
#    GJL - 08/21/98  Changed the session.tmpl file (column runmode) to binary
#                    mode (2) from ASCII delimited mode (130). This makes it
#                    non-portable, but 40% faster. Change it to 130 for
#                    portability.
# MAIN
# Check usage.
# This function takes care of 18 character table names.
# Cut out the underscores to decrease the length.
# If the length is still 18 then see if the 1st 17 chars are unique.
# If the directory is not specified then exit (the compressed table name
# has been echoed.
# Set the number of files to a default of 1.
# Try to import the onpload database, a failure means it's there.
# Check the database.
# Check the table.
# See if load and unload jobs for this table exist already.
# Get the hostname and servername.
# Get the (max. of each serial key) + 1.
# Formats table
# Maps table.
# If SK_MAPU is NULL make it 0.
# Session table.
# Device table.
# Formatitem table for load.
# Formatitem table for unload.
# Format table for load.
# Format table for unload.
# Mapitem table for load.
# Mapitem table for unload.
# Maps table for load.
# Maps table for unload.
# Query table for load/unload.
# Session table for load.
# Session table for unload.
# Load it.
Source: README, updated 2020-05-11