English

Metavault API - Update data package table

UpdateDataPackageTable - PUT

Path

/api/projects/{projectId}/metavault/sourcesystems/{sourceNameOrId}/datapackages/{dataPackageNameOrId}/tables/{tableId}

Http Method

PUT

Overview

This query is used to update the Query or the Name of a datapackage table(staging table).

As both actions require database changes, either the Query or the Name can be updated at one time (i.e. per one call). Not both.

Required permissions

  • Write access to the Source module. BUILD WRITE

Request

Request body

JSON
{
  "query": "SELECT * FROM ...",
  "name": "myso01_mydatapackage1_newname"
}
Field descriptions

Field

Type

Required

Description

Constraints

query

string

Yes

The query associated with this View and or Table.

If the argument query differs from the existing query, it is updated.

If you change this parameter you are not allowed to change the name.

name

string

Yes

The name of the table.

If the argument name differs from the existing name, it is updated.

If you change this parameter you are not allowed to change the query.

Response

Success response (200 OK)

Before 7.0.0 :

JSON
{
  "_embedded": {
    "columns": [
      {
        "id": "df84cf1a9690437894fa6f5506344167",
        "name": "column1",
        "dataType": "String",
        "length": 255,
        "baseType": {
          "isText": true,
          "isBinary": false,
          "type": "String",
          "dataType": "String",
          "length": 255,
          "autoIncrement": false
        },
        "nullable": false,
        "technicalDescription": "",
        "businessDescription": "",
        "businessName": "",
        "primaryKey": true,
        "typeFullName": "VARCHAR(255)"
      },
      {
        "id": "eb44fb54f6cb4198a06d546da230cb19",
        "name": "column2",
        "dataType": "String",
        "length": 50,
        "baseType": {
          "isText": true,
          "isBinary": false,
          "type": "String",
          "dataType": "String",
          "length": 50,
          "autoIncrement": false
        },
        "nullable": true,
        "technicalDescription": "",
        "businessDescription": "",
        "businessName": "",
        "primaryKey": false,
        "typeFullName": "VARCHAR(50)"
      },
      {
        "id": "ed64872843064b60845561bbc1d42059",
        "name": "column3",
        "dataType": "String",
        "length": 10,
        "baseType": {
          "isText": true,
          "isBinary": false,
          "type": "String",
          "dataType": "String",
          "length": 10,
          "autoIncrement": false
        },
        "nullable": true,
        "technicalDescription": "",
        "businessDescription": "",
        "businessName": "",
        "primaryKey": false,
        "typeFullName": "VARCHAR(10)"
      }
    ]
  },
  "id": "23973d8d0fea47bf8e45d991dbc33d5f",
  "tableName": "myso01_mydatapackage1_newname",
  "targetTableName": "myso01_mydatapackage1_newname",
  "targetSchemaName": "stg",
  "sourceSystemId": "3c24b0fb-a999-48e9-9b41-209412a47df3",
  "dataPackageId": "ca761ccf-1cbd-4d5f-92ca-bccef1c5deda",
  "query": "",
  "queryType": "Table",
  "isQueryBased": false
}

Starting from 7.0.0 (new column/HR types definitions respect the formalism defined in Metavault API - General concepts | Column types) For specifics of data package tables, see response of: Metavault API - Create data package table:

JSON
{
  "_embedded": {
    "columns": [
      {
        "id": "df84cf1a9690437894fa6f5506344167",
        "name": "column1",
        "businessName": "column1",
        "technicalDescription": "",
        "businessDescription": "",
        "nullable": false,
        "primaryKey": true,
        "dataType": "String",
        "dataTypeCustom": null,
        "length": 255,
        "precision": null,
        "scale": null,
        "typeFullName": "VARCHAR(255)",
        "baseDataType": "String",
        "baseDataTypeCustom": null,
        "baseLength": 255,
        "basePrecision": null,
        "baseScale": null,
        "baseTypeFullName": "VARCHAR(255)",   
        "hardRuleDataType": null,
        "hardRuleDataTypeCustom": null,
        "hardRuleLength": null,
        "hardRulePrecision": null,
        "hardRuleScale": null,
        "hardRuleTypeFullName": null
      },
      {
        "id": "eb44fb54f6cb4198a06d546da230cb19",
        "name": "column2",
        "businessName": "column2",
        "technicalDescription": "",
        "businessDescription": "",
        "nullable": true,
        "primaryKey": false,
        "dataType": "String",
        "dataTypeCustom": null,
        "length": 50,
        "precision": null,
        "scale": null,
        "typeFullName": "VARCHAR(50)",
        "baseDataType": "String",
        "baseDataTypeCustom": null,
        "baseLength": 50,
        "basePrecision": null,
        "baseScale": null,
        "baseTypeFullName": "VARCHAR(50)",   
        "hardRuleDataType": null,
        "hardRuleDataTypeCustom": null,
        "hardRuleLength": null,
        "hardRulePrecision": null,
        "hardRuleScale": null,
        "hardRuleTypeFullName": null
      },
      {
        "id": "ed64872843064b60845561bbc1d42059",
        "name": "column3",
        "businessName": "column3",
        "technicalDescription": "",
        "businessDescription": "",
        "nullable": true,
        "primaryKey": false,
        "dataType": "String",
        "dataTypeCustom": null,
        "length": 10,
        "precision": null,
        "scale": null,
        "typeFullName": "VARCHAR(10)",
        "baseDataType": "String",
        "baseDataTypeCustom": null,
        "baseLength": 10,
        "basePrecision": null,
        "baseScale": null,
        "baseTypeFullName": "VARCHAR(10)",   
        "hardRuleDataType": null,
        "hardRuleDataTypeCustom": null,
        "hardRuleLength": null,
        "hardRulePrecision": null,
        "hardRuleScale": null,
        "hardRuleTypeFullName": null
      }
    ]
  },
  "id": "23973d8d0fea47bf8e45d991dbc33d5f",
  "tableName": "myso01_mydatapackage1",
  "targetTableName": "myso01_mydatapackage1",
  "targetSchemaName": "stg",
  "sourceSystemId": "3c24b0fb-a999-48e9-9b41-209412a47df3",
  "dataPackageId": "ca761ccf-1cbd-4d5f-92ca-bccef1c5deda",
  "query": "",
  "queryType": "Table",
  "isQueryBased": false
}