Simple data Import Export command in Informix SH program

Source: Internet
Author: User
Tags exit chmod informix linux

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;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.