inserting delimited records
into an existing table

one of the best ways to of adding records to an existing madsearch2 table is to use mad2's insert delimited records utility.

this utility allows you to add the records that exist within a delimited text file to your table. it is important that the number of data fields within the delimited file and their order correspond to the underlying madsearch2 table's structure. For example, if our madsearch2 table has four data fields entitled Name, Address, CityStateZip, and PhoneNumber; the delimited file from which we will be adding records should have four fields containing corresponding data in the proper order:

"John Doe","123 Dumb Bunny Lane","Ossining, NY 10025","914.555.1212"

there are two things to note when using the insert delimited records utility:

in order to insert delimited records into a madsearch2 table, simply follow these instructions:

:: phase one :: providing madsearch2 with the file
step 1

From the madsearch2 menu, select the "Insert Delimited Records" option. The first screen on the madsearch2 insert delimited records utility will appear.

The first screen of the utility will prompt you as to where you wish to upload the delimited text file and from where on your local system it should look to obtain it.

step 2

In the field named, "Where Should I Put The Import File?", enter the directory path to which you may upload files. For example,

/wwws/data/cu/pooh

Please note that the upload feature uses madUpload. The target directory must have a .upaclu (user permissions file) or .upacla (affiliations permissions file) granting you the privilege to upload files.

step 3

In the field named, "Where Should I Get The Import File From?", type the location of the delimited file from which you wish to insert records. Note the handy "Browse" button your browser provides for assisting you in finding the file's location. For example,

c:\mydocuments\addresses.txt

step 4

When you have reviewed your selections, click the "Send File" button to upload the delimited file from your local system.

step 5

The next screen that appears will contain an upload status message. You should verify that the number of bytes transferred corresponds to the size of your delimited text file.

Should there be a problem during the transport, your browser will not warn you. It will simply pretend that all was well. If the number of bytes transferred reads "0", you probably misspelled the file to transfer or something similarly silly. Should this happen simply click your browser's "Back" button, correct the problem, and re-send the delimited file.


At this point, you have confirmed that your delimited text file was transferred in phase one of this process. You will now instruct madsearch2 as to how to parse your file.


:: phase two :: importing the delimited file records for insertion
step 1

Beneath the file transfer status section, will be an "Insert Delimited Records" section. Within this section, find the field named "Table Directory". In this field, type the directory path of the table into which you wish to insert records. For example,

/wwws/data/cu/pooh

step 2

Next, in the field named, "Table Name", enter the name of the table into which you wish to insert records. For example,

mytable

step 3

From the choices presented to you within the field, "Fields Are Separated By", select the character that separates the data fields which comprise your delimited records.

The standard separator characters are among your choices: commas, tabs, and semi-colons. If you wish to use a different character, select the "Other" option and type the character you wish to use in the "Other" option's associated field.

step 4

From the choices presented to you within the field, "Fields Are Delimited By", select the character which delimits the data fields of each record.

The standard delimiter characters are among your choices: quotes and nothing (no character at all). If you wish to use a different character, select the "Other" option and type the character you wish to use within the "Other" option's associated field.

step 5 When you have reviewed your selections, click the "Insert Records" button.

As madsearch2 inserts records into the table, it will output error messages if necessary (eg. key violation). in addition, with every error message, madsearch2 will tell you the record line of the delimited file on which the error occurred.

When the insertion process is complete, madsearch2 will display a status message indicating the number of records it successfully inserted into the table you specified.