Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 从Exact Online插入联系人时,Freshdesk上的错误无效_值_Sql_Exact Online_Freshdesk_Invantive Sql_Invantive Control - Fatal编程技术网

Sql 从Exact Online插入联系人时,Freshdesk上的错误无效_值

Sql 从Exact Online插入联系人时,Freshdesk上的错误无效_值,sql,exact-online,freshdesk,invantive-sql,invantive-control,Sql,Exact Online,Freshdesk,Invantive Sql,Invantive Control,在Freshdesk测试环境中,以下SQL语句将销售订单涉及的所有联系人从Exact Online复制到Freshdesk: insert into contacts@freshdesk ( name , address , phone , email ) select delivery_account_name , fulladdress , account_phone , account_email from freshdesktickets@inmemor

在Freshdesk测试环境中,以下SQL语句将销售订单涉及的所有联系人从Exact Online复制到Freshdesk:

insert into contacts@freshdesk
( name
, address
, phone
, email
)
select delivery_account_name
,      fulladdress
,      account_phone
,      account_email
from   freshdesktickets@inmemorystorage
以下SQL用于根据准确的在线数据准备Freshdesk票证:

create table FreshdeskTickets@inmemorystorage
as
select dlvl.delivery_account_name
,      acad.fulladdress,acad.account_phone
,      acad.account_email
from   ExactonlineXML..DeliveryLines@eolnl dlvl
join   fulladdress@inmemorystorage acad
on     acad.id_attr = dlvl.delivery_deliveryaddress_id_attr
where  dlvl.deliverydate_attr = '2016-10-07'
group 
by     dlvl.delivery_account_name
,      acad.fulladdress
,      acad.account_phone
,      acad.account_email
这运行没有问题。在客户的Freshdesk环境中执行此SQL语句时,收到一个错误,代码为itgenoda001(见图):验证失败。所有消息:无效值:精确值:它应该是以下值之一:“Ja,Nee”


显然,使用的Freshdesk有不同的版本。如何调整查询以使其在两个版本上都能正常工作?

您收到此错误消息的原因是,您的第二次Freshdesk安装中有一个名为
exact_koppeling
的自定义字段,该字段在您的测试安装中缺失

没有简单的方法可以避免这种情况。您也必须将自定义字段添加到测试安装中,或者必须维护同一语句的两个版本

我想您需要这样的
insert
语句,以便在第二次安装中使用:

insert
into contacts@freshdesk
( name
, address
, phone
, email
, exact_koppeling
)
select delivery_account_name
,      fulladdress
,      account_phone
,      account_email
,      'Ja' -- Or 'Nee'
from   freshdesktickets@inmemorystorage