我正在尝试从命令行运行 SSIS 包,但我不断收到这个
“ORA-00907:缺少右括号”。
该包从 SSDT 运行良好,我使用的查询也是一个简单的查询。我确实尝试在运行时将值传递给查询。
变量声明:
我的查询使用表达式:
"SELECT country_id, city_id, name FROM cities where instr('" + @[User::p_cityID] + "' || ',', city_id || ',') > " + @[User::p_count]
最终查询:(运行良好)
SELECT country_id, city_id, name FROM cities where instr('DUBAI' || ',', city_id || ',') > 0
包调用:
Begin
declare @p_cityId varchar(10) = 'DUBAI'
declare @p_count varchar(10) = '0'
declare @query varchar(4000) =
'"C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\DTExec.exe" /FILE C:\SSIS\pmtCity.dtsx /decrypt <mypass> /reporting V > C:\SSIS\log\citylog_'+
(replace(replace(replace(replace(convert(varchar(23), getdate(), 121),'-',''),':',''),' ',''),'.','')) +'.txt'
+ ' /SET \Package.Variables[p_cityID].Value;''' + @p_cityId + ''''
+ ' /SET \Package.Variables[p_count].Value;''' + @p_count + ''''
print @query
exec xp_cmdshell @query
End