[ic] Catalog is not valid...after using database

Jamie Neil interchange-users@icdevgroup.org
Wed May 28 08:54:00 2003


> -----Original Message-----
> From: interchange-users-admin@icdevgroup.org
> [mailto:interchange-users-admin@icdevgroup.org]On Behalf Of Vincent Lee
> Sent: 28 May 2003 13:06
> To: interchange-users@icdevgroup.org
> Subject: RE: [ic] Catalog is not valid...after using database
>
>
> Hi Jamie,
>
> Should I erase the <table>.txt files in the products directory?

As far as I'm aware (and I'm far from an expert) the txt files are where the
sql tables are built from.

As an example, if I want to add a new table to IC, I would create a tab
delimited text file (<table>.txt), with the column names in the first row,
and put it in the products folder. In order to make IC process it, I need to
add an entry to the catalog.cfg file in the form:

	Database            <table>        <table>.txt      TAB

Now when IC is restarted the table will be available as <table>.

TAB is the simplist table type, for a mysql database you would do:

	Database		<table>	<table>.txt		dbi:mysql:<database>

In this case the table is imported into the mysql database from the
<table>.txt file. Then a <table>.mysql file is created in the products
folder (instead of a gdbm file) to indicate that the source of the data is
an sql database, not the <table>.txt file. If you delete <table>.mysql then
the next time IC restarts it will drop the mysql database (without warning)
and recreate it using the text file.

If your sql database already exists, you can add a "NoImport" line in
catalog.cfg listing the tables that should _never_ be imported. This is a
good idea with important tables as it avoids the risk of your live sql data
being overwritten with the original (unupdated) txt file data.

In the foundation demo things are complicated by the use of variables and
include file (dbconf/<database type>/), however the process is the same.

All this is in the IC docs (although finding it can be hard work), so for
further advice, read the database docs
(http://www.icdevgroup.org/i/dev/documentation.html?document=icdatabase),
and study the foundation demo for examples. I tend to use
http://www.interchange.rtfm.info/docs/index.html as my most common reference
as it is easier to navigate.

Jamie Neil

PS If you top post (place your responses at the top of the email rather than
inline) many people on this list will ignore your questions. Please see the
list guidelines for more information. I'm not quite that jaded (yet) :)