我是C#的新手。我的问题是我想使用第7列及以上的数量将ean,描述,书码,价格和折扣插入SQL Server:
我当前的代码可以插入数据,但是数量已经定义。我正在考虑进行循环,但出现错误
必须声明标量变量
我不确定我的逻辑是正确的。
这是我的SQL Server表的屏幕截图:
我的代码:
A = pd.merge(A, B['brand','city'], how='left',
left_on='station_uuid', right_on='uuid')
答案 0 :(得分:1)
在您的b = [
{
"id": "160407",
"created": "2017-10-30T09:41:37.960+0000",
"items": [
{
"field": "status",
"fieldtype": "test",
"from": "10407",
"fromString": "Analysis",
"to": "4",
"toString": "To Do"
}
]
},
{
"id": "160407",
"created": "2019-10-30T09:41:37.960+0000",
"items": [
{
"field": "status",
"fieldtype": "test",
"from": "10407",
"fromString": "Analysis",
"to": "3",
"toString": "In Progress"
}
]
}
]
循环中,您有:
def recursive(obj, path=None):
if path is None:
path = []
# Check for object type and unpacked
if isinstance(obj, dict):
for key, value in obj.items():
# Write path for this key
new_path = list(path)
new_path.append(key)
# Check Status = in progress
condition = 'to' in obj and '3' == obj['to']
if condition:
print(new_path) #Print correct value
return new_path #None
recursive(value, path=new_path)
# Check for list type and unpacked
elif isinstance(obj, list):
for i, item in enumerate(obj):
new_path = list(path)
new_path.append(i)
recursive(item, path=new_path)
a = recursive(b) #None
因此,在执行查询之前,您要清除 all 先前添加的参数。