关于sqlite:SQLITEERROR-table-XX-has-no-column-named-currency

24次阅读

共计 445 个字符,预计需要花费 2 分钟才能阅读完成。

在做 SAP Cloud Application Programming 练习时,遇到如下的谬误音讯:
SQLITE_ERROR: table sap_capire_bookshop_books has no column named currency

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

然而通过 csv 文件导入数据到 sqlite in memory 数据库时,却遇到了本文题目形容的谬误音讯。

这里有个诀窍,拜访 url:

http://localhost:4004/browse/…

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

在 csv 文件里将字段名改为 currency_code, 谬误隐没:

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

正文完
 0