dbf2msql v0.4

OVERVIEW:

This program takes an xBase-file and sends queries to an mSQL-server to
insert it into an msql-table. It takes a number of arguments to set its
behaviour:

-v verbose:
   Produce some status-output

-vv more verbose:
   Also produce progres-report.

-u uppercase:
   Translate all text in the xbase-file to uppercase

-l lowercase:
   Translate all text in the xbase-file to lowercase

-d database:
   Select the database to insert into. Default is 'test'

-t table:
   Select the table to insert into. Default is 'test'

-c create:
   If the table already exists, drop it and build a new one.
   The default is to insert all data into the named table.

-p primary:
   Select the primary key. You have to give the exact
   field-name.

-h host:
   Select the host where to insert into. Untested.


It does not handle memo-files, because you would need something like the
varchar type (planned for mSQL 2.0), and is maybe not as well tested as it
should have been, but it works for me (and others as I have been told).


INSTALL:

To build it, take a look at the Makefile. You might have to change a
few things.

First of all, there's the compiler you use. Then you have to tell where
your 'install' program is. I use the syntax as in Solaris /usr/sbin/install,
and I don't know if this is the one with the most standard arguments, so
please bare with me if you have to fiddle with it.

Then, tell what compiler-options you want (probably optimizing :). The next
step is important: tell where your Minerva/mSQL is installed, since this
needs include-files and libraries from there. 

Next, tell where you want the binary to be installed (directory-name).

Some operating-systems require extra libraries to be linked against, Solaris
for example needs -lsocket and -lnsl to compile this cleanly. Specify this
in EXTRALIBS.

Then you're probably set to go. There are 3 more options you can change, but
you only need them if you want to do a 'make dist'. These are 'RM', 'GZIP' and
'TAR'. Of these, probably the only one that _could_ give trouble is gzip,
but you probably already have this, else you wouldn't have succeeded in
reading this document :).

COPYRIGHT:

Use this piece of software as you want, modify it to suit your needs,
but please leave my name in place ok? :)

DISCLAIMER:

I do not accept any responsibility for possible damage you get as result
of using this program.

KNOWN BUGS:

-  It doesn't handle memo-files. If somebody has specifications of these,
   please let me know and I'll see if I can add support for them.

OTHER BUGS:

None that I know of, but it's always possible they're there. If you find any,
please let me know, and I'll see what I can do.

CHANGES:

dbf2msql-0.4:

-  fixed a little offset-bug. I came across a file that had an extra char
   inserted after the header. However, the headerlength-field was correct,
   so I changed the program to use this instead of calculating the
   headerlength ourself. Should have done this in the first place.

dbf2msql-0.3:

-  moved call to do_create() to inside the check if to create the table
   or import it into an existing one

dbf2msql-0.2:

-  Reorganized the code, cleaned up main(), moved building and sending
   of 'create-clause' to do_create() and moved building and sending
   of 'insert-clauses' to do_inserts.
-  Changed allocation of (char *)query in do_create() from static
   to dynamic, thus avoiding overruns.
-  Changed allocation of (char *)query, (char *)keys and (char *)vals
   in do_inserts() from static to dynamic, thus preventing overruns.
-  Fixed a nasty little bug in freeing allocated memory in
   dbf_free_record(). This was stupid, and only showed up *after*
   the code-reorganization. Don't know why I didn't notice it before.
   If you had *very* large dbases (with large fields), this could fill
   up your memory completely.
-  Added the -l option on suggestion from David Perry
   (deperry@zeus.nerosworld.com)
-  Added the -c option (dito)
-  Added the -vv option
-  Enhanced documentation (this little doc)

dbf2msql-0.1:

-  Initial release

Maarten Boekhold (boekhold@cindy.et.tudelft.nl)
