Informix database with two commands: Load and unload
We can according to facilitate the preparation of SH program data import and export, the following two sections of the SH program in Redhat Linux as 4 test pass, should be suitable for most unix,linux operating system, put under $informix_home$/bin, You can use Informix when you log on, and remember chmod +x load and chmod +x unload
##!/bin/ksh;
If [$#-ne 3]
Then
echo "Error:arguments is not Enough"
echo "Usage:load dbname filename tablename";
echo "e.g.: Load Cmsdbs custinfo.unl custinfo";
Exit
Fi
dbname=$1;
filename=$2;
tablename=$3;
Dbaccess <<!
Database $dbname;
Load from $filename insert into $tablename;
!
##!/bin/ksh;
If [$#-ne 3]
Then
echo "Error:arguments is not Enough";
echo "Usage:unload dbname filename tablename";
echo "e.g.: Unload Cmsdbs custinfo.unl custinfo";
Exit
Fi
dbname=$1;
filename=$2;
tablename=$3;
Dbaccess <<!
Database $dbname;
##!/bin/ksh;
If [$#-ne 3]
Then
echo "Error:arguments is not Enough";
echo "Usage:unload dbname filename tablename";
echo "e.g.: Unload Cmsdbs custinfo.unl custinfo";
Exit
Fi
dbname=$1;
filename=$2;
tablename=$3;
Dbaccess <<!
Database $dbname;
Unload to $filename select * from $tablename;
Unload to $filename select * from $tablename;