SQLITE_ERROR - table XX has no column named currency

在做 SAP Cloud Application Programming 练习时,遇到如下的错误消息:
SQLITE_ERROR: table sap_capire_bookshop_books has no column named currency
SQLITE_ERROR - table XX has no column named currency_第1张图片

在我的 schema 定义里,Books entity 里确实存在一个叫做 currency 的字段,但其数据类型为 Currency,来自 @sap/cds/common,而非 built-in 数据类型比如 Integer,String,Decimal等等。

SQLITE_ERROR - table XX has no column named currency_第2张图片

然而通过 csv 文件导入数据到 sqlite in memory 数据库时,却遇到了本文标题描述的错误消息。

这里有个窍门,访问 url:

http://localhost:4004/browse/...

发现Books entity的currency字段,其对应的数据库字段名称应该为 currency_code, 而非 currency:

SQLITE_ERROR - table XX has no column named currency_第3张图片

在 csv 文件里将字段名改为 currency_code, 错误消失:

SQLITE_ERROR - table XX has no column named currency_第4张图片

SQLITE_ERROR - table XX has no column named currency_第5张图片

更多Jerry的原创文章,尽在:"汪子熙":

你可能感兴趣的:(SQLITE_ERROR - table XX has no column named currency)