Example Schema: Multiple Output Tables

This example loads data into two tables simultaneously. Small descriptive data is loaded into one table. Full text gets loaded into the other table. Both tables are loaded with the same key field so they can be related again later on.

database /tmp/testdb
recdelim \x0c
#       Name            Type            Tag     Default value
field   load1.Subject   varchar         Subject
field   load1.From      varchar         From
field   load1.Date      date            Date
field   load1.Number    long            Number  0
field   load2.Number    long            Number  0
field   load2.File      indirect        -
field   load2.Text      varchar         -

This is the schema as above, except that it loads the key fields with generated numbers instead of relying on keys from the input text.

database /tmp/testdb
recdelim \x0c
#       Name            Type            Tag     Default value
field   load1.Subject   varchar         Subject
field   load1.From      varchar         From
field   load1.Date      date            Date
field   load1.Number    long            -       #100
field   load2.Number    long            -       #100
field   load2.File      indirect        -
field   load2.Text      varchar         -

Here are a few sample records. The "^L" should be a Control-L which is used as the record delimiter.

From: multiple record file
Subject: First multiple record
Number: 1
Date: 1995-04-19 11:31:00

This is my message; this is my file.
^L
From: multiple record file
Subject: Second multiple record
Number: 2
Date: 1995-04-19 11:32:00

This is another message.
^L
From: multiple record file
Subject: Third multiple record
Number: 3
Date: 1995-04-19 11:33:00

This is getting tedious!
I'm going to stop now.


Copyright © Thunderstone Software     Last updated: Dec 10 2018
Copyright © 2019 Thunderstone Software LLC. All rights reserved.