#!/usr/bin/ksh
#
# Name:    informixScript familyName
#
# Purpose: This is a sample shell script that shows
#          how to issue a set of Informix command lines.
#
# Note:    If you get the following message when invoking isql or dbaccess:
#              The type of your terminal is unknown to the system
#          Then you may need to specify a value for TERM that is recognized by
#          Informix. In our experience the following statement helps to overcome
#          this problem:
#              export TERM=vt100

# Process the proper number if input parameters

if [ "$#" -ne 1 ]
then
   print -u2 'usage:  informixScript familyName   '
   exit 1
else
   print 'informixScript: Starting script ' $1
fi

export LOG=informixScript.out

####### Customization notes #############################################
# Place the actual Informix commands inside the begin and end !!!
# Remember to put the ; (semicolon) at the end of each logical statement
#########################################################################

dbaccess  $1 >> $LOG 2>&1 <<!!!
select * from Sequence;
!!!
# The above !!! indicates the end of the long series of Informix commands

print ' '
print 'informixScript: Please see the following log for the details'
print '          of the execution of the Informix commands: ' $LOG
print ' '
print 'informixScript: End of script'

exit 0

# end of file
