1
我的動態查詢出現問題,因爲我有一些空值。如果它沒有任何值,我已將值設置爲可選,但仍然出現錯誤。有什麼想法嗎?數據庫可選參數錯誤
這是我對數據庫連接器的動態查詢。我認爲問題出在BROKER和COTTON組織聲明上
insert into [AWH_PrjPathFinder].[dbo].[ws_balesDataExt] values ('#[payload['FULLDATE']]', '#[payload.BROKER = (payload['BROKER'] == null) ? '' : payload.BROKER.toString()]', '#[payload.CENTER = (payload['CENTER'] == null) ? '' : payload.CENTER.toString()]', '#[payload.DATATYPE = (payload['DATATYPE'] == null) ? '' : payload.DATATYPE.toString()]','#[payload.COTTONORG = (payload['COTTONORG'] == null) ? '' : payload.COTTONORG.toString()]',#[payload['UNIT']],'#[payload['dateDataEnteredInAGDB']]')
這是我的示例輸入文件。
[ {
"FULLDATE": "28/09/2015",
"CENTER": "B",
"DATATYPE": "CDLV",
"UNIT": "195" },
{
"FULLDATE": "28/09/2015",
"CENTER": "M",
"DATATYPE": "CRCV",
"UNIT": "47"
},
{
"FULLDATE": "28/09/2015",
"CENTER": "M",
"DATATYPE": "CRCV",
"UNIT": "60"
},
{
"FULLDATE": "28/09/2015",
"CENTER": "M",
"DATATYPE": "DDMP",
"UNIT": "84"
},
{
"FULLDATE": "28/09/2015",
"CENTER": "M",
"DATATYPE": "DRCV",
"UNIT": "24"
},
您應該列出插入到'insert'語句中的所有列。 –
還在收到什麼錯誤? – Morpheus
在處理錯誤時添加錯誤消息(全部)&將來,在沒有我們請求的情況下請執行此操作 –