Informix to Postgres Script

Friday Feb 7th 2003 by DatabaseJournal.com Staff
Share:

This well-tested bash script is used to transfer data from Informix to PostgreSQL.



>>Script Language and Platform: Bash - Sed
This well-tested bash script is used to transfer data from Informix to PostgreSQL. Copy and paste the script into an sqlparser.sh file and make it executable. (Only works in UNIX).

Author: Vasilis Ventirozos


sqlparser File Table
Script Code: #!/bin/bash
if test $# -ne 2
then echo "usage: sqlparser <File> <Table>" 
exit;
fi
echo "COPY "$2" FROM stdin;" >$1.pg
cat $1|sed ''s/|$//'' | sed ''s/,/\./g''
|sed -e ''s/|/      /g'' >>$1.pg
echo "\." >>$1.pg
echo ""
echo "Transform Complete to upload run cat $1.pg |psql <SERVER>"
echo ""


Disclaimer: We hope that the information on these script pages is valuable to you. Your use of the information contained in these pages, however, is at your sole risk. All information on these pages is provided "as -is", without any warranty, whether express or implied, of its accuracy, completeness, or fitness for a particular purpose... Disclaimer Continued


Back to Database Journal Home

Share:
Home
Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved