URL: http://<db.host>:<db.port>/append/records
Append (or insert) all records from a source table (specified by input parameter source_table_name) to a particular target table (specified by input parameter table_name). The field map (specified by input parameter field_map) holds the user specified map of target table column names with their mapped source column names.
Input Parameter Description
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
table_name | string | The table name for the records to be appended, in [schema_name.]table_name format, using standard name resolution rules. Must be an existing table. | ||||||||||||||||||||||||||||
source_table_name | string | The source table name to get records from, in [schema_name.]table_name format, using standard name resolution rules. Must be an existing table name. | ||||||||||||||||||||||||||||
field_map | map of string to strings | Contains the mapping of column names from the target table (specified by input parameter table_name) as the keys, and corresponding column names or expressions (e.g., 'col_name+1') from the source table (specified by input parameter source_table_name). Must be existing column names in source table and target table, and their types must be matched. For details on using expressions, see Expressions. | ||||||||||||||||||||||||||||
options | map of string to strings | Optional parameters. The default value is an empty map ( {} ).
|
Output Parameter Description
The GPUdb server embeds the endpoint response inside a standard response structure which contains status information and the actual response to the query. Here is a description of the various fields of the wrapper:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
status | String | 'OK' or 'ERROR' | |||||||||
message | String | Empty if success or an error message | |||||||||
data_type | String | 'append_records_response' or 'none' in case of an error | |||||||||
data | String | Empty string | |||||||||
data_str | JSON or String | This embedded JSON represents the result of the /append/records endpoint:
Empty string in case of an error. |