6.3. Import
-
Named Parameters: [import table=table_name type=(TAB|PIPE|CSV|%%|LINE) continue=(NOTES|UNIX|DITTO) separator=c]
Positional Parameters: [import table_name TAB]
The attribute hash reference is passed after the parameters but before the container text argument. This may mean that there are parameters not shown here. Interpolates container text by default>.
This is a container tag, i.e., [import] FOO [/import].
Nesting: NO
Invalidates cache: YES.
Called Routine:
ASP/perl tag calls:
$Tag->import( { table => VALUE, type => VALUE, }, BODY )
-
OR
$Tag->import($table, $type, $ATTRHASH, $BODY);
-
Attribute aliases:
base ==> table database ==> table
-
Description:
Import one or more records into a database. The type is any of the valid Interchange delimiter types, with the default being defined by the setting of the database DELIMITER. The table must already be a defined Interchange database table; it cannot be created on-the-fly. (Use SQL for on-the-fly tables.)
The type of LINE and continue setting of NOTES is particularly useful, for it allows the naming of fields so that the order in which they appear in the database will not have to be remembered. The following two imports are identical in effect:
[import table=orders type=LINE continue=NOTES] 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 or key must always be present, and is always named code. If NOTES mode is not used, import the fields in the same order as they appear in the ASCII source file. The [import ....] TEXT [/import] region may contain multiple records. If using NOTES mode, use a separator, which by default is a form-feed character (^L).