你有输入数据的样本吗?
我将创建新问题,因为我想,由于逗号作为分隔符,我在将数字从一个软件转换为 PowerAutomate 变量以将其添加到 decimal(18,2) sql 表列时遇到问题。我尝试使用 Python 脚本替换字符串中的 char,但 Python 将此变量视为元组!
这对我有用 - 在 sql 查询中替换 replace("%totalGrossAmount%",",","."):
SET QUOTED_IDENTIFIER OFF
SET ANSI_NULLS ON INSERT INTO vouchers (voucher, organizationId, voucherType, voucherStatus, voucherNumber, voucherDate, shippingDate, dueDate, totalGrossAmount, totalTaxAmount, taxType, useCollectiveContact, contactId, remark, amount, taxAmount, taxRatePercent, categoryId, files, createdDate, updatedDate, version) values ("%voucher%", "%organizationId%", "%type%", "%voucherStatus%", "%voucherNumber%", "%voucherDate%", "%shippingDate%", "%dueDate%", replace("%totalGrossAmount%",",","."), replace("%totalTaxAmount%",",","."), "%taxType%", "%useCollectiveContact%", "%contactId%", "%remark%", replace("%amount%",",","."), replace("%taxAmount%",",","."), replace("%taxRatePercent%",",","."), "%categoryId%", "%files%", "%createdDate%", "%updatedDate%", %version%)