Relational Databases - An Example - Importing Data

This page follows on from database example page.

I found some data, in order to get it into the database I first edited it so that it is in CSV (Comma Separated Variable) format.

I have put a copy here: nutrition.csv

This is a text format where each field is in quotes and separated by commas. Each entry is on a separate line.

csv file

First I started Calc program and opened the CSV file, this brings up the following dialog box:

calc select

This should be set to separate with comma, then press OK, then select all the elements we want to include in the database, press edit->copy or control-c to copy to clipboard.

calc select

Leave the Calc program (don't exit) and start Open Base program. This brings up the following Wizard:

Leave set to "Create a new database" and click on next:


Leave the above default values and click on finish:


Enter name of database and click on OK which brings up the following screen:


In the Database pane click on 'Tables':


Click on the Tables pane and while the cursor is in the Tables pane type control-v. this brings up the following

copy 1

Set the table name and also set 'Create primary key' then press next

Click on '>>' to select all columns and click on next:

copy 3

I modified the length of type, barcode and hydrodised to 50.

The fields energykj, energykc, protein, carb, sugar, fat, saturates, fibre and sodium to:

Field Type Double
Length 17
Decimal Places 0

I could not change the Decimal places from 0, I assume this allows any value.

Clicking on Create shows the byWeightQuantities table:

base 6

The Calc program can now be exited leaving the base program loaded with the data.

Next stage - go on to: Setting up a form

Other sections are:


metadata block
see also:



Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.


Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to this site, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.


This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2017 Martin John Baker - All rights reserved - privacy policy.