IBM / db2-samples

Db2 application code, configuration samples, and other examples
https://www.ibm.com/analytics/developing-with-db2
Apache License 2.0
85 stars 86 forks source link

Regression_Demo.ipynb Notebook - Create LINREG.GSTEST_STD table as Row Org to allow Alter Table #52

Closed db2Dean closed 1 year ago

db2Dean commented 2 years ago

You will get an error in the "Standardize AGE in Test Data" cell if you are using Db2 Warehouse or other database that defaults to a column organized tables. The error happens in the step where the column is renamed in this cell. It appears that you can't rename columns in a column organized table. I fix this by changing this line:

sql = "CREATE TABLE LINREG.GSTEST_STD AS (SELECT * FROM LINREG.GSTEST) WITH DATA"

to this:

sql = "CREATE TABLE LINREG.GSTEST_STD AS (SELECT * FROM LINREG.GSTEST) WITH DATA ORGANIZE BY ROW"

kdrodger commented 2 years ago

Thanks @db2Dean . Let me see if I can route this to the right people for their thoughts.