3

我在本机查询中使用“in”运算符时遇到问题,其中 in 参数是通过钻取 excel 列表检索到的列表:

let
   var = Number.ToText(fnFuncao("externalcode")),
   Coluna= Excel.CurrentWorkbook(){[Name="Pendente"]}[Content],
   #"Changed Type" = Table.TransformColumnTypes(Coluna,{{"PARAMETER", Int64.Type}, {"INTERACTION_ID", Int64.Type}, {"INTERACTION_ITEM", Int64.Type}}),
   INTERACTION_ID = #"Changed Type"[INTERACTION_ID][0],
   Source = Oracle.Database("somp", [Query="select * from ish.ticket where    interaction_id in (" & INTERACTION_ID & ") "])
in
    Source

Error:
    Expression.Error: We cannot apply operator & to types Text and List.
    Details:
    Operator=&
    Left=select * from ish.ticket where interaction_id in (
    Right=List

有什么办法可以解决这个问题?谢谢!

4

1 回答 1

3

我不知道为什么 INTERACTION_ID 被视为一个列表。这两个更改应该可以解决您的问题:

  1. 将 INTERACTION_ID 更改为#"Changed Type"[INTERACTION_ID]{0},
  2. 将查询设置为"select * from ish.ticket where interaction_id in (" & Number.ToText(INTERACTION_ID) & ")"

第一个更改使用列表访问运算符 {} 而不是记录访问运算符 []。第二个更改将 INTERACTION_ID 转换为 Text 值,以便可以使用 & 将其添加到其他 Text 值。

于 2015-09-01T00:23:19.133 回答