Reference

dbf2pg(1)

Insert xBase-style .dbf-files into an mSQL or Postgres95-table

NAME

dbf2sql - Insert xBase-style .dbf-files into an mSQL or Postgres95-table

SYNOPSIS

dbf2msql [options] dbf-file
dbf2pg [options] dbf-file

Options:
[-v[v]] [-f] [-u | -l] [-c | -D] [-d database] [-t table] [-h host] [-s oldname=newname[,oldname=newname]] [-p primary key] [-s start] [-e end]

DESCRIPTION

This manual page documents the programs dbf2msql and dbf2pg. These take an xBase-style .dbf-file, and insert it into the specified database and table.

OPTIONS

-v

Display some status-messages.

-vv

Also display progress.

-f

Convert all field-names from the .dbf-file to lowercase.

-u

Convert the contents of all fields to uppercase.

-l

Convert the contents of all fields to lowercase.

-c

Create the table specified with -t. If this table already exists, first DROP it.

-D

Delete the contents of the table specified with -t. Note that this table has to exists. An error is returned if this is not the case.

-d database

Specify the database to use. An error is returned if this database does not exists. Default is "test".

-t table

Specify the table to insert in. An error is returned if this table does not exists. Default is "test".

-h host

Specify the host to which to connect. Default is "localhost".

-s oldname=newname[,oldname=newname]

Change the name of a field from oldname to newname. This is mainly used to avoid using reserved SQL-keywords. Example:

-s SELECT=SEL,COMMIT=doit

This is done before the -f operator has taken effect!

-p primary key

Specify which field to use as the primary key. Only for dbf2msql. This operates on the fieldnames that are valid AFTER substitutions with -s are carried out!

-s start

Specify the first record-number in the xBase-file we will insert.

-e end

Specify the last record-number in the xBase-file we will insert.

ENVIRONMENT

These programs are effected by the environment-variables as used by mSQL and Postgres95. See the documentation of those programs for more info.

BUGS

At the moment none that I know, except for some lacking functionallity.

AVAILABILITY

You can get the latest version by anonymous FTP from ftp.nerosworld.com/pub/msql/contrib/dbf2msql