Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2878

Cannot change the structure of the hdbtable after table import ?

$
0
0

Hello,

 

I have a problem with change the structure of the hdbtable after table import in a package.

 

Step1: I define a hdbtable and activate it. The table "MyPackage::Z_ImportTest" will be created.

 

// Z_ImportTest.hdbtable


 

table.schemaName = "MySchema";

table.tableType = COLUMNSTORE;

 

table.columns =

[

    {name = "MY_COL1";  sqlType = VARCHAR;  length = 20; },

    {name = "MY_COL2";  sqlType = INTEGER; },

    {name = "MY_COL3";  sqlType = NVARCHAR; length = 20; }

];


Step 2: I create a csv file Z_ImportTest.csv and activate it.

 

AAA;1;XXX

BBB;2;YYY

 

Step 3: I define a import configuration file and activate it. The content of csv file will be now imported into the hdbtable.


 

// Z_ImportTest.hdbti


 

import =

[

  {

     table = "MyPackage::Z_ImportTest";

     schema = "MySchema";

     file = "MyPackage:Z_ImportTest.csv";

     header = false;

     delimField = ";";                      

  }

];


 

Step 4: I add a new column in the hdbtable and csv file.

 

// Z_ImportTest.hdbtable


 

table.schemaName = "MySchema";

table.tableType = COLUMNSTORE;

 

table.columns =

[

  {name = "MY_COL1"; sqlType = VARCHAR;  length = 20; },

  {name = "MY_COL2"; sqlType = INTEGER; },

  {name = "NEW_COL"; sqlType = INTEGER; },

  {name = "MY_COL3"; sqlType = NVARCHAR; length = 20; }

];

 

AAA;1;8;XXX

BBB;2;9;YYY

 

 

Now I can only activate csv file and cannot activate the hdbtable. I get the error message:

 

MyPackage:Z_ImportTest.hdbti

Repository: Internal error during statement execution,

please see the database error traces for additional details 

The csv file: MyPackage:Z_ImportTest.csv does not match to target table: MyPackage::Z_ImportTest.

The type of at least one entry in record 0 does not match to the type of columns.

column: NEW_COL(4) entry: XXX.

 

 

Cansomebodyhelpmetosolvethisproblem?

 

Regards,

Y. Hu


Viewing all articles
Browse latest Browse all 2878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>