For more information... RTFM!
NAVIGATION
PAGES THAT LINK HERE
ACCOUNT LOGIN

You are not logged in

Powered by Interchange version 5.7.0

import

Import one or more rows into a database table.

Summary

  • [import table type] column names and the values to import [/import]

Parameter Description Default
table table to import/write records into. None
base Alias for table. None
database Alias for table. None
type Any of the valid Interchange delimiter types. None
continue None
separator character to separate multiple record import. ASCII FF (^L)
hide

Suppress any output text that would ordinarily be returned from this tag.  (This universal parameter was introduced with Interchange version 5.5.2.)

No

Examples

ICML usage

[import table=table_name
    type=(TAB|PIPE|CSV|%%|LINE)
    continue=(NOTES|UNIX|DITTO)
    separator=c
]

Perl example

$Tag->import({
    table => $table,
    type => $type,
    body => $body,
});

or similarly with positional parameters:

$Tag->import($table, $type, $attribute_hash_reference, $body);

Description

Import one or more rows into a database table.  The type is any of the valid Interchange delimiter types, with the default being defined by the setting of the DELIMITER.  Non-SQL tables must already be defined within the Interchange configuration, as they cannot be created on the fly.  If you need that, it is time to use SQL.

The type of LINE and continue setting of NOTES is particularly useful, as it allows you to name your columns and not have to remember the order in which they appear in the table.  The following two imports have an identical effect:

[import table=orders]
    code: [value mv_order_number]
    shipping_mode: [shipping-description]
    status: pending
[/import]
[import table=orders type=line continue=notes]
    shipping_mode: [shipping-description]
    status: pending
    code: [value mv_order_number]
[/import]

The code (table key) must always be present, and is always named code.  If you do not use NOTES mode, you must import the fields in the same order as they appear in the ASCII source file.

The [import]...[/import] region may contain multiple rows If using NOTES mode, you must use a separator, which by default is a form-feed character (^L).

Parameters

table

Any existing table defined in the Interchange configuration.

type

"TAB", "PIPE", "CSV", "%%" or "LINE".

continue

"NOTES", "UNIX" or "DITTO".

separator

Category:  Interchange tags
Last modified by: Kevin Walsh
Modification date: Monday 17 July 2006 at 8:19 PM (CDT)
Home  |  Legal nonsense  |  Privacy policy  |  Donations  |  Contact us