Re: load a table includes 350 000 records
Posted in 2005
You can load rows from a file a few at a time using "dbload". However,
the Shell script listed below makes this process rather easier.
--
Regards,
Doug Lawry
www.douglawry.webhop.org
___________
__| dbload.sh |___________________________________________________________
# Load a table with data from a file using "dbload"
# Doug Lawry, 04/04/2003
[ $# -lt 2 ] && exec echo "Usage: $0 database file [...]"
DATABASE=$1 ; shift ; TEMP=/tmp/dbload.$$
for FILE
do
TABLE=`basename $FILE .unl`
OUTPUT=`
echo "SELECT ncols FROM systables WHERE tabname = '$TABLE'" |
dbaccess $DATABASE - 2>&1
`
NCOLS=`
echo "$OUTPUT" | awk '/^ +[0-9]+$/ {print $1}'
`
case "$OUTPUT" in *"No rows found"*)
echo " 206: The specified table ($TABLE) is not in the database."
echo " 111: ISAM error: no record found."
continue ;;
esac
case "$NCOLS" in "")
echo "$OUTPUT" | egrep .
exit 1 ;;
esac
echo "FILE $TABLE.unl DELIMITER '|' $NCOLS; INSERT INTO $TABLE;" \\
> $TEMP.1
dbload -d $DATABASE -c $TEMP.1 -l $TEMP.2 -n 2000 -r
cat $TEMP.2
rm $TEMP.?
done
__________________________________________________________________________
<Muthana.AL-Temimi@tu-harburg.hamburg.de> wrote in message
news:1114700027.033c21841870bb10f8b1d986fe03bdf3@teranews...
>
> Hello there,
>
> I tried to load table including 350 000 records. But Informix cannot do
> that for me. I divide the records into three parts then I loaded them.
>
> My question what shall I do to avoid this process. What I mean I don't
> need to divide the records into three parts and load them serial
>
> Any help will be good
>
> Muthana
> ------------------------------------------
> Technische Universit't Hamburg-Harburg
> Muthana AL-Temimi
> IuK - Referat
> Tel.: 040 42878 3294
> Email: muthana.al-temimi@tu-harburg.hamburg.de