Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Command Index > G > GATEWAY > IMPORT

JSON (JavaScript Object Notation)

Scroll Prev Top Next More

Syntax:

 

GATEWAY IMPORT JSON +

filename.json {APPEND/APPEND_UPDATE/CREATE/REPLACE} +

<tablename> +

OPTION SPECIFICATION_FILE_NAME filename +

|COLUMN_COUNT value +

|KEYS value +

|ADD_MAPPING value +

|AUTONUM value +

|FIRST_ROW n +

|LAST_ROW n +

|SHOW_PROGRESS value +

|MESSAGES value +

|ERROR_FILE EXCEPT.DAT +

|NODE_PATH value

 

filename.json

This parameter defines the file name of the target file with data using the JSON format. File extension must be json.

 

APPEND

Adds the imported data to the end of the table or view specified in tblview.

 

APPEND_UPDATE

Updates the record if it exists in the tblview destination, otherwise the record is added. In order to specify a matching row for the UPDATE comparison, use the KEYS parameter.

 

CREATE

Creates a destination table with the same name as the imported file.

 

REPLACE

Replaces the rows in the table or view specified in tblview with the imported data.

 

tblview

Specifies the name of a table or view for import.

 

OPTION

 

ADD_MAPPING

This parameter assigns a source column to a destination table column, rather than relying on column position.

 

AUTONUM

This parameter specifies whether the data imported will follow the auto-numbering formula for the table. Available Parameters: ON / OFF

 

COLUMN_COUNT

This parameter specifies the number of columns to be imported from file. COLUMN_COUNT is only supported when using CREATE in the GATEWAY syntax.

 

ERROR_FILE

Specifies a file to capture errors encountered during the import process.

 

FIRST_ROW

This parameter specifies the first row(s) to be used within the file that is being imported into the table.

 

KEYS

This parameter specifies the matching row to compare for table updates with the APPEND_UPDATE import mode. For multiple key fields to locate a matching row, use a comma separated list of field names.

 

LAST_ROW

This parameter specifies the last row to be used within the file that is being imported into the table.

 

MESSAGES

If ON, during import process some messages will be displayed such as -ERROR- messages, if any. If OFF, the entire import process will be in "silent" mode. Available Parameters: ON / OFF

 

NODE_PATH

Specifies the full path of the target node (e.g. Fantasy\BOOKS). The NODE_PATH parameter may be set to the root node path with a backslash character (meaning the root). The change is applicable to JSON files where only the data row items are in the file. If the PATH is invalid or is not provided, the dialog prompt is displayed to select a node. The NODE_PATH value is case sensitive.

 

SHOW_PROGRESS

Indicates whether to display status dialog during the import process. Set SHOW_PROGRESS to OFF if you wish to hide the animated status dialog during the import process. Available Parameters: ON / OFF

 

SPECIFICATION_FILE_NAME

This parameter is used to load a prepared specification with all pre-defined settings for importing. The import must be performed once using the graphic user interface and saved using the "Specifications.." button. The specifications will be stored in a file with the .RGW file extension. The .RGW file acts as a set of default values. Any value in the .RGW file will be overwritten by the same parameter specifically assigned by an OPTION parameter. Since the input file name is required in the GATEWAY command, the input file name in the .RGW will always be overwritten.

 

Examples:

 

GATEWAY IMPORT JSON D:\DataStore\Contacts.JSON CREATE ContactsImport OPTION NODE_PATH Level\Contact

 

GATEWAY IMPORT JSON D:\DataStore\Transactions.JSON APPEND TransLog OPTION SHOW_PROGRESS OFF|MESSAGES OFF

 

--This command will only append cell B, cell C and cell D data into the Company, CustAddress and CustState columns of the Customer table.

GATEWAY IMPORT JSON Customer.JSON APPEND Customer +

OPTION ADD_MAPPING Company=B|ADD_MAPPING CustAddress=C|ADD_MAPPING CustState=D

 

GATEWAY IMPORT JSON CustResponse.json REPLACE CustResponse OPTION FIRST_ROW 1|NODE_PATH \