on 06-01-2015 2:22 PM
Hi folks.
I´m trying to develope a little XS app in HANA Cloud Platform Cockpit > Developement Workbench.
I created a model.hdbdd file with this content:
namespace fleedscout.data;
@Schema: '_SYS_BIC'
context mymodel {
type SString: String(60);
@Catalog.tableType:
#COLUMN Entity fleed {
key tplnr: SString;
tplkz: SString;
fltyp: SString;
};
};
I misstyped fltyp though. Didnt´t realize until later and when I now rename it and try to save/activate the following error message pops up:
Error while activating /fleedscout/data/mymodel.hdbdd:
Modification of a CDS artifact failed because corresponding data cannot be migrated. Reason: cannot apply modifier "not null" to column "tplnr" in nonempty table "_SYS_BIC"."fleedscout.data::mymodel.fleed"; you should define a default value.
Need advise. I am still a beginner.
Hello Kai,
did you also add "key" in front of column "tplnr"? Because the message says, that you cannot apply "not null" (implicit by key definition) to the column. So it seems that you have already entries in your table with lines which have a null value in column tplnr which you wanna define as key.
The "renaming" (drop column, add column) works already for CDS in revision 85 which is available on HCP at the moment. If you have already entries in that column you should first add the new column, copy the values from the old column to the new column and then remove the old column.
Best Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Flo!
Yes, when I go to the catalog and select my table then I see that tplnr is the key as defined in the code I posted first.
When I click on "Open content" I can see that the table is filled with data. I am certain that there is no empty field.
However i know now, that i cannot rename rows - i have to drop them and readd them. I did so and it worked. Thank you for your hint!
Please find the context in your file :
Eg: model.hdbdd
namespace fleedscout.data;
@Schema: '_SYS_BIC'
context model {
type SString: String(60);
@Catalog.tableType:
#COLUMN Entity fleed {
key tplnr: SString;
tplkz: SString;
fltyp: SString;
};
};
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.